From 720bb64266f5719a8c2d4c936e2264a7f0d5c6ee Mon Sep 17 00:00:00 2001 From: Elia el Lazkani Date: Tue, 4 Jul 2023 19:18:15 +0200 Subject: [PATCH] chore(): Adds logging credentials if existent --- scripts/get-scan-report.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/get-scan-report.sh b/scripts/get-scan-report.sh index e0636b8..7446b70 100755 --- a/scripts/get-scan-report.sh +++ b/scripts/get-scan-report.sh @@ -12,6 +12,18 @@ report_digest=$(echo "$image_information" | tail -n1 | awk -F ' ' '{print $2}') #printf "$report_digest\n" printf "Found digests for scan report...\n" +extra_vars="" + +if [[ -v REGISTRY_USERNAME ]] +then + extra_vars="$extra_vars --username $REGISTRY_USERNAME" +fi + +if [[ -v REGISTRY_PASSWORD ]] +then + extra_vars="$extra_vars --password $REGISTRY_PASSWORD" +fi + image_base=$(echo "$image" | awk -F ':' '{print $1}') printf "Pulling $image_base:@$report_digest...\n" -oras pull "$image_base:@$report_digest" +oras pull "$extra_vars" "$image_base:@$report_digest"