From f05ea3dff2ae4316318999c55632a94542cb15b1 Mon Sep 17 00:00:00 2001 From: arewm Date: Thu, 25 Jul 2024 15:43:17 -0400 Subject: [PATCH] Ensure that /shared/base_images_digests exists When there are no base images (i.e. it is FROM scratch), we need to make sure that the base_images_digests file exists. Signed-off-by: arewm --- task/buildah-oci-ta/0.2/buildah-oci-ta.yaml | 1 + task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml | 1 + task/buildah-remote/0.2/buildah-remote.yaml | 1 + task/buildah/0.2/buildah.yaml | 1 + 4 files changed, 4 insertions(+) diff --git a/task/buildah-oci-ta/0.2/buildah-oci-ta.yaml b/task/buildah-oci-ta/0.2/buildah-oci-ta.yaml index 96d8c3ed91..92f9c295e7 100644 --- a/task/buildah-oci-ta/0.2/buildah-oci-ta.yaml +++ b/task/buildah-oci-ta/0.2/buildah-oci-ta.yaml @@ -404,6 +404,7 @@ spec: cp /tmp/cachi2/output/bom.json ./sbom-cachi2.json fi + touch /shared/base_images_digests for image in $BASE_IMAGES; do if [ "${image}" != "scratch" ]; then buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >>/shared/base_images_digests diff --git a/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml b/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml index 0388b5245c..6db39a03ca 100644 --- a/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml +++ b/task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml @@ -416,6 +416,7 @@ spec: cp /tmp/cachi2/output/bom.json ./sbom-cachi2.json fi + touch /shared/base_images_digests for image in $BASE_IMAGES; do if [ "${image}" != "scratch" ]; then buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >>/shared/base_images_digests diff --git a/task/buildah-remote/0.2/buildah-remote.yaml b/task/buildah-remote/0.2/buildah-remote.yaml index 81038369fa..f23ebb69c9 100644 --- a/task/buildah-remote/0.2/buildah-remote.yaml +++ b/task/buildah-remote/0.2/buildah-remote.yaml @@ -398,6 +398,7 @@ spec: cp /tmp/cachi2/output/bom.json ./sbom-cachi2.json fi + touch /shared/base_images_digests for image in $BASE_IMAGES; do if [ "${image}" != "scratch" ]; then buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> /shared/base_images_digests diff --git a/task/buildah/0.2/buildah.yaml b/task/buildah/0.2/buildah.yaml index c731057375..425ec93ae7 100644 --- a/task/buildah/0.2/buildah.yaml +++ b/task/buildah/0.2/buildah.yaml @@ -340,6 +340,7 @@ spec: cp /tmp/cachi2/output/bom.json ./sbom-cachi2.json fi + touch /shared/base_images_digests for image in $BASE_IMAGES; do if [ "${image}" != "scratch" ]; then buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> /shared/base_images_digests