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
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
Log activity when recording base image digests
  • Loading branch information
ralphbean committed Jan 6, 2025
commit fe977d2328afe33f7864a723529a5707d77a0cb0
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
@@ -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:
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
@@ -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:
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
@@ -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

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
@@ -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

3 changes: 2 additions & 1 deletion task/buildah-remote/0.2/buildah-remote.yaml
Original file line number Diff line number Diff line change
@@ -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

3 changes: 2 additions & 1 deletion task/buildah-remote/0.3/buildah-remote.yaml
Original file line number Diff line number Diff line change
@@ -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

3 changes: 2 additions & 1 deletion task/buildah/0.2/buildah.yaml
Original file line number Diff line number Diff line change
@@ -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

3 changes: 2 additions & 1 deletion task/buildah/0.3/buildah.yaml
Original file line number Diff line number Diff line change
@@ -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

Loading