Skip to content

Commit

Permalink
Merge pull request #2353 from snyk/feat/CAP-280-improve-user-instruct…
Browse files Browse the repository at this point in the history
…ion-info

feat: Improve output for dockerfile instructions
  • Loading branch information
pecodez authored Nov 24, 2021
2 parents 452e035 + 4690660 commit c6bbeda
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"semver": "^6.0.0",
"snyk-config": "4.0.0",
"snyk-cpp-plugin": "2.13.0",
"snyk-docker-plugin": "4.26.1",
"snyk-docker-plugin": "4.27.0",
"snyk-go-plugin": "1.18.0",
"snyk-gradle-plugin": "3.17.0",
"snyk-module": "3.1.0",
Expand Down
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 @@ -446,7 +446,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
10 changes: 6 additions & 4 deletions test/acceptance/cli-test/cli-test.docker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export const DockerTests: AcceptanceTests = {
dockerfilePackages: {
'openssl@1.5.0': {
instruction: 'RUN apk add openssl@1.5.0',
installCommand: 'apk add openssl@1.5.0',
},
},
dockerfileLayers: {
Expand Down Expand Up @@ -264,6 +265,7 @@ export const DockerTests: AcceptanceTests = {
dockerfilePackages: {
'openssl@1.5.0': {
instruction: 'RUN apk add openssl@1.5.0',
installCommand: 'apk add openssl@1.5.0',
},
},
dockerfileLayers: {
Expand Down Expand Up @@ -649,7 +651,7 @@ export const DockerTests: AcceptanceTests = {
data: {
dockerfilePackages: {
bzip2: {
instruction: 'RUN test instruction',
installCommand: 'test installCommand',
},
},
},
Expand Down Expand Up @@ -678,7 +680,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 +699,7 @@ export const DockerTests: AcceptanceTests = {
data: {
dockerfilePackages: {
bzip2: {
instruction: 'RUN test instruction',
installCommand: 'test installCommand',
},
},
},
Expand Down Expand Up @@ -726,7 +728,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 c6bbeda

Please sign in to comment.