Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log activity when recording base image digests #1790

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,13 @@ spec:
echo $container >/shared/container_name

touch /shared/base_images_digests
echo "Recording base image digests used"
for image in $BASE_IMAGES; do
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >>/shared/base_images_digests
echo "$image $base_image_digest" | tee -a /shared/base_images_digests
fi
done
computeResources:
Expand Down
3 changes: 2 additions & 1 deletion task/buildah-oci-ta/0.3/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,13 @@ spec:
echo $container >/shared/container_name

touch /shared/base_images_digests
echo "Recording base image digests used"
for image in $BASE_IMAGES; do
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >>/shared/base_images_digests
echo "$image $base_image_digest" | tee -a /shared/base_images_digests
fi
done
computeResources:
Expand Down
3 changes: 2 additions & 1 deletion task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,13 @@ spec:
echo $container >/shared/container_name

touch /shared/base_images_digests
echo "Recording base image digests used"
for image in $BASE_IMAGES; do
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >>/shared/base_images_digests
echo "$image $base_image_digest" | tee -a /shared/base_images_digests
fi
done

Expand Down
3 changes: 2 additions & 1 deletion task/buildah-remote-oci-ta/0.3/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,13 @@ spec:
echo $container >/shared/container_name
touch /shared/base_images_digests
echo "Recording base image digests used"
for image in $BASE_IMAGES; do
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >>/shared/base_images_digests
echo "$image $base_image_digest" | tee -a /shared/base_images_digests
fi
done
Expand Down
3 changes: 2 additions & 1 deletion task/buildah-remote/0.2/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,13 @@ spec:
echo $container > /shared/container_name

touch /shared/base_images_digests
echo "Recording base image digests used"
for image in $BASE_IMAGES; do
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >> /shared/base_images_digests
echo "$image $base_image_digest" | tee -a /shared/base_images_digests
fi
done

Expand Down
3 changes: 2 additions & 1 deletion task/buildah-remote/0.3/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,13 @@ spec:
echo $container > /shared/container_name

touch /shared/base_images_digests
echo "Recording base image digests used"
for image in $BASE_IMAGES; do
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >> /shared/base_images_digests
echo "$image $base_image_digest" | tee -a /shared/base_images_digests
fi
done

Expand Down
3 changes: 2 additions & 1 deletion task/buildah/0.2/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,13 @@ spec:
echo $container > /shared/container_name

touch /shared/base_images_digests
echo "Recording base image digests used"
for image in $BASE_IMAGES; do
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >> /shared/base_images_digests
echo "$image $base_image_digest" | tee -a /shared/base_images_digests
fi
done

Expand Down
3 changes: 2 additions & 1 deletion task/buildah/0.3/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,13 @@ spec:
echo $container > /shared/container_name

touch /shared/base_images_digests
echo "Recording base image digests used"
for image in $BASE_IMAGES; do
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >> /shared/base_images_digests
echo "$image $base_image_digest" | tee -a /shared/base_images_digests
fi
done

Expand Down
Loading