snyk 1.809.0 → 1.810.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2781,6 +2781,7 @@ function createErrorMappedResultsForJsonOutput(results) {
2781
2781
  }
2782
2782
  exports.createErrorMappedResultsForJsonOutput = createErrorMappedResultsForJsonOutput;
2783
2783
  function getDisplayedOutput(res, options, testedInfoText, localPackageTest, projectType, meta, prefix, multiProjAdvice, dockerAdvice) {
2784
+ var _a;
2784
2785
  const vulnCount = res.vulnerabilities && res.vulnerabilities.length;
2785
2786
  const singleVulnText = res.licensesPolicy ? 'issue' : 'vulnerability';
2786
2787
  const multipleVulnsText = res.licensesPolicy ? 'issues' : 'vulnerabilities';
@@ -2811,7 +2812,7 @@ function getDisplayedOutput(res, options, testedInfoText, localPackageTest, proj
2811
2812
  const fixTip = show_fix_tip_1.showFixTip(projectType, res, options);
2812
2813
  const fixAdvice = fixTip ? `\n\n${fixTip}` : '';
2813
2814
  const dockerfileWarning = getDockerfileWarning(res.scanResult);
2814
- const dockerSuggestion = getDockerSuggestionText(options, config_1.default);
2815
+ const dockerSuggestion = getDockerSuggestionText(options, config_1.default, (_a = res === null || res === void 0 ? void 0 : res.docker) === null || _a === void 0 ? void 0 : _a.baseImage);
2815
2816
  const vulns = res.vulnerabilities || [];
2816
2817
  const groupedVulns = groupVulnerabilities(vulns);
2817
2818
  const sortedGroupedVulns = orderBy(groupedVulns, ['metadata.severityValue', 'metadata.name'], ['asc', 'desc']);
@@ -2859,7 +2860,7 @@ function dockerUserCTA(options) {
2859
2860
  return '';
2860
2861
  }
2861
2862
  exports.dockerUserCTA = dockerUserCTA;
2862
- function getDockerSuggestionText(options, config) {
2863
+ function getDockerSuggestionText(options, config, baseImageRes) {
2863
2864
  if (!options.docker || options.isDockerUser) {
2864
2865
  return '';
2865
2866
  }
@@ -2867,9 +2868,11 @@ function getDockerSuggestionText(options, config) {
2867
2868
  if (config && config.disableSuggestions !== 'true') {
2868
2869
  const optOutSuggestions = '\n\nTo remove this message in the future, please run `snyk config set disableSuggestions=true`';
2869
2870
  if (!options.file) {
2870
- dockerSuggestion +=
2871
- chalk_1.default.bold.white('\n\nPro tip: use `--file` option to get base image remediation advice.' +
2872
- `\nExample: $ snyk test --docker ${options.path} --file=path/to/Dockerfile`) + optOutSuggestions;
2871
+ if (!baseImageRes) {
2872
+ dockerSuggestion +=
2873
+ chalk_1.default.bold.white('\n\nSnyk wasn’t able to auto detect the base image, use `--file` option to get base image remediation advice.' +
2874
+ `\nExample: $ snyk container test ${options.path} --file=path/to/Dockerfile`) + optOutSuggestions;
2875
+ }
2873
2876
  }
2874
2877
  else if (!options['exclude-base-image-vulns']) {
2875
2878
  dockerSuggestion +=