Skip to content

Commit

Permalink
feat: Improve output for dockerfile instructions
Browse files Browse the repository at this point in the history
This commit allows for use of the installCommand extracted
from a RUN instruction in newer versions of the SDP.

[CAP-280]
  • Loading branch information
pecodez committed Nov 23, 2021
1 parent 9ab4e54 commit 2043232
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/snyk-test/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ async function parseRes(
const dockerfilePackage = dockerfilePackages[vuln.name.split('/')[0]];
if (dockerfilePackage) {
(vuln as DockerIssue).dockerfileInstruction =
dockerfilePackage.instruction;
dockerfilePackage.installCommand;
}
(vuln as DockerIssue).dockerBaseImage = res.docker!.baseImage;
return vuln;
Expand Down
8 changes: 4 additions & 4 deletions test/acceptance/cli-test/cli-test.docker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ export const DockerTests: AcceptanceTests = {
data: {
dockerfilePackages: {
bzip2: {
instruction: 'RUN test instruction',
installCommand: 'test installCommand',
},
},
},
Expand Down Expand Up @@ -678,7 +678,7 @@ export const DockerTests: AcceptanceTests = {
t.fail('should have found vuln');
} catch (err) {
const msg = err.message;
t.match(msg, "Image layer: 'RUN test instruction'");
t.match(msg, "Image layer: 'test installCommand'");
}
},

Expand All @@ -697,7 +697,7 @@ export const DockerTests: AcceptanceTests = {
data: {
dockerfilePackages: {
bzip2: {
instruction: 'RUN test instruction',
installCommand: 'test installCommand',
},
},
},
Expand Down Expand Up @@ -726,7 +726,7 @@ export const DockerTests: AcceptanceTests = {
t.fail('should have found vuln');
} catch (err) {
const msg = err.message;
t.match(msg, "Image layer: 'RUN test instruction'");
t.match(msg, "Image layer: 'test installCommand'");
}
},

Expand Down

0 comments on commit 2043232

Please sign in to comment.