Skip to content

Commit

Permalink
Ensure that Chains sees all image manifests referenced
Browse files Browse the repository at this point in the history
Due to a bug in Chains, it does not currently see all images produced
within a matrix. In order to work around this, we can expose all images
that we include in our Image Index so that Chains can generate the
provenance for all of them.

Signed-off-by: arewm <[email protected]>
  • Loading branch information
arewm committed Jul 26, 2024
1 parent 1da26f8 commit 313e926
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions task/build-image-manifest/0.1/build-image-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
name: IMAGE_DIGEST
- description: Image repository where the built image was pushed
name: IMAGE_URL
- description: List of all referenced image manifests
name: IMAGES
stepTemplate:
env:
- name: BUILDAH_FORMAT
Expand Down Expand Up @@ -72,6 +74,7 @@ spec:
sed -i 's/^\s*short-name-mode\s*=\s*.*/short-name-mode = "disabled"/' /etc/containers/registries.conf
image_manifests=""
buildah manifest create "$IMAGE"
for i in $@
do
Expand All @@ -82,6 +85,7 @@ spec:
TOADD="$(echo $i | cut -d: -f1)@sha256:$(echo $i | cut -d: -f3)"
fi
echo "Adding $TOADD"
image_manifests="${image_manifests} ${TOADD},"
buildah manifest add $IMAGE "docker://$TOADD" --all
done
Expand All @@ -102,8 +106,9 @@ spec:
exit 1
fi
cat image-digest | tee $(results.IMAGE_DIGEST.path)
echo -n "$IMAGE" | tee $(results.IMAGE_URL.path)
cat image-digest | tee "$(results.IMAGE_DIGEST.path)"
echo -n "$IMAGE" | tee "$(results.IMAGE_URL.path)"
echo -n "${image_manifests:1:-1}" > "${results.IMAGES.path}"
securityContext:
capabilities:
add:
Expand Down

0 comments on commit 313e926

Please sign in to comment.