From 83167675c520adfdac210c2483dafdaff399a182 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 | 3 ++- task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml | 3 ++- task/buildah-remote/0.2/buildah-remote.yaml | 1 + task/buildah/0.2/buildah.yaml | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) 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..dfb06f7da0 100644 --- a/task/buildah-oci-ta/0.2/buildah-oci-ta.yaml +++ b/task/buildah-oci-ta/0.2/buildah-oci-ta.yaml @@ -404,9 +404,10 @@ 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 + buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> /shared/base_images_digests fi done 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..a6aacdb89f 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,9 +416,10 @@ 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 + buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> /shared/base_images_digests fi done 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