From a2d37bc444614840cc0485289ef728d15cf23964 Mon Sep 17 00:00:00 2001 From: arewm Date: Wed, 5 Jun 2024 15:43:01 -0400 Subject: [PATCH] fix(STONEBLD-2496, KFLUXBUGS-1317) Ensure that the base image digest result is present If there is no base image (i.e. if the image is only FROM scratch), then the file will not be present and therefore step-create-base-images-sbom will fail. Resolves: https://issues.redhat.com/browse/STONEBLD-2496 Resolves: https://issues.redhat.com/browse/KFLUXBUGS-1317 Signed-off-by: arewm --- task/buildah-oci-ta/0.1/buildah-oci-ta.yaml | 1 + task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml | 1 + task/buildah-remote/0.1/buildah-remote.yaml | 1 + task/buildah/0.1/buildah.yaml | 1 + 4 files changed, 4 insertions(+) diff --git a/task/buildah-oci-ta/0.1/buildah-oci-ta.yaml b/task/buildah-oci-ta/0.1/buildah-oci-ta.yaml index 1c61de7488..3829b2ed9d 100644 --- a/task/buildah-oci-ta/0.1/buildah-oci-ta.yaml +++ b/task/buildah-oci-ta/0.1/buildah-oci-ta.yaml @@ -272,6 +272,7 @@ spec: fi # Expose base image digests + touch $(results.BASE_IMAGES_DIGESTS.path) for image in $BASE_IMAGES; do if [ "${image}" != "scratch" ]; then buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> $(results.BASE_IMAGES_DIGESTS.path) diff --git a/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml b/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml index 4a52f82760..3918534995 100644 --- a/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml +++ b/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml @@ -322,6 +322,7 @@ spec: fi # Expose base image digests + touch $(results.BASE_IMAGES_DIGESTS.path) for image in $BASE_IMAGES; do if [ "${image}" != "scratch" ]; then buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> $(results.BASE_IMAGES_DIGESTS.path) diff --git a/task/buildah-remote/0.1/buildah-remote.yaml b/task/buildah-remote/0.1/buildah-remote.yaml index 59b32d2698..df91bb3122 100644 --- a/task/buildah-remote/0.1/buildah-remote.yaml +++ b/task/buildah-remote/0.1/buildah-remote.yaml @@ -329,6 +329,7 @@ spec: fi # Expose base image digests + touch $(results.BASE_IMAGES_DIGESTS.path) for image in $BASE_IMAGES; do if [ "${image}" != "scratch" ]; then buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> $(results.BASE_IMAGES_DIGESTS.path) diff --git a/task/buildah/0.1/buildah.yaml b/task/buildah/0.1/buildah.yaml index 1edb649f5e..061ad9c09a 100644 --- a/task/buildah/0.1/buildah.yaml +++ b/task/buildah/0.1/buildah.yaml @@ -281,6 +281,7 @@ spec: fi # Expose base image digests + touch $(results.BASE_IMAGES_DIGESTS.path) for image in $BASE_IMAGES; do if [ "${image}" != "scratch" ]; then buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> $(results.BASE_IMAGES_DIGESTS.path)