From c36a8f2944a9ca7778c402c67fa90ea92e738845 Mon Sep 17 00:00:00 2001 From: Luiz Carvalho Date: Tue, 8 Oct 2024 14:38:36 -0400 Subject: [PATCH] Include image index digest in clair-scan Task This was missed when the v0.2 version of the clair-scan Task was introduced. Ref: https://issues.redhat.com/browse/EC-906 Signed-off-by: Luiz Carvalho --- task/clair-scan/0.2/clair-scan.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/task/clair-scan/0.2/clair-scan.yaml b/task/clair-scan/0.2/clair-scan.yaml index f4999eb7f8..ed1a1bdac1 100644 --- a/task/clair-scan/0.2/clair-scan.yaml +++ b/task/clair-scan/0.2/clair-scan.yaml @@ -129,9 +129,12 @@ spec: fi done + # If the image is an Image Index, also add the Image Index digest to the list. + if [[ "${digests_processed[*]}" != *"$IMAGE_DIGEST"* ]]; then + digests_processed+=("\"$IMAGE_DIGEST\"") + fi digests_processed_string=$(IFS=,; echo "${digests_processed[*]}") - # add the image_index to the processed digests list and store the result in a file images_processed=$(echo "${images_processed_template/\[%s]/[$digests_processed_string]}") echo "$images_processed" > images-processed.json - name: oci-attach-report