From 31a3c63aa2e50fdb739f8cd29a80969a6e791803 Mon Sep 17 00:00:00 2001 From: Pushkar Joglekar Date: Tue, 23 Nov 2021 15:40:17 -0800 Subject: [PATCH] Removes printing of scan results - Remove echo of scan results, keeps debug flag - Adds comment on why exit 1 is commented --- .../sig-k8s-infra/trusted/sig-security-trusted.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/jobs/kubernetes/sig-k8s-infra/trusted/sig-security-trusted.yaml b/config/jobs/kubernetes/sig-k8s-infra/trusted/sig-security-trusted.yaml index ff82a83ca403..b5ddc386500e 100644 --- a/config/jobs/kubernetes/sig-k8s-infra/trusted/sig-security-trusted.yaml +++ b/config/jobs/kubernetes/sig-k8s-infra/trusted/sig-security-trusted.yaml @@ -38,14 +38,13 @@ periodics: EXIT_CODE=0 RESULT_UNFILTERED=$(snyk test -d --json) || EXIT_CODE=$? if [ $EXIT_CODE -gt 1 ]; then - echo "Failed to run snyk scan with exit code $EXIT_CODE . Error message: $RESULT_UNFILTERED" + echo "Failed to run snyk scan with exit code $EXIT_CODE " exit 1 fi RESULT=$(echo $RESULT_UNFILTERED | jq \ '{vulnerabilities: .vulnerabilities | map(select((.type != "license") and (.version != "0.0.0"))) | select(length > 0) }') if [[ ${RESULT} ]]; then echo "Vulnerability filtering failed" - echo "Snyk tool output:\n $RESULT_UNFILTERED" exit 1 else echo "Scan completed" @@ -66,8 +65,7 @@ periodics: '{vulnerabilities: .vulnerabilities | map(select(.isUpgradable == true or .isPatchable == true)) | select(length > 0) }') if [[ ${RESULT} ]]; then echo "Vulnerability filtering failed" - echo "Snyk tool output:\n $RESULT_UNFILTERED" - #exit 1 + # exit 1 (To allow other images to be scanned even if one fails) else echo "Scan completed image $image" fi