Skip to content

Commit

Permalink
fix: cri-dockerd always with execution permission
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed Dec 23, 2022
1 parent 17fbbaa commit 1e9b544
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/download.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ describe('download module test suite', () => {
});
test('should install cri-dockerd binary', async () => {
// When
await download.installCriDockerd({githubToken: 'secret-token'});
await download.installCriDockerd();
// Then
expect(tc.extractTar).toHaveBeenCalledWith('cri-dockerd.tgz');
expect(exec.logExecSync).toHaveBeenCalledWith(
expect.stringMatching(
/sudo cp -a .+\/cri-dockerd\/cri-dockerd \/usr\/local\/bin\//
/sudo install -m 0755 .+\/cri-dockerd\/cri-dockerd \/usr\/local\/bin\//
)
);
expect(exec.logExecSync).toHaveBeenCalledWith(
Expand Down
2 changes: 1 addition & 1 deletion src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const installCriDockerd = async (inputs = {}) => {
// Binary
const binaryDir = await tc.extractTar(binaryTar);
const binaryContent = firstDir(binaryDir);
logExecSync(`sudo cp -a ${binaryDir}/${binaryContent}/cri-dockerd /usr/local/bin/`);
logExecSync(`sudo install -m 0755 ${binaryDir}/${binaryContent}/cri-dockerd /usr/local/bin/`);
logExecSync(`sudo ln -sf /usr/local/bin/cri-dockerd /usr/bin/cri-dockerd`);
// Service file
const sourceTar = await tc.downloadTool(`https://github.com/Mirantis/cri-dockerd/archive/refs/tags/${tag}.tar.gz`);
Expand Down

0 comments on commit 1e9b544

Please sign in to comment.