Skip to content

Commit

Permalink
Update delete-untagged-amazon-public-ecr-images.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alessfg committed Feb 21, 2025
1 parent d043f2d commit b29f834
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function batch_delete {
# otherwise any referenced untagged images can not be deleted.
IMAGE_DIGESTS=$(aws ecr-public describe-images \
--repository-name "${REPOSITORY_NAME}" \
--query 'imageDetails[?!imageTags && (contains(imageManifestMediaType, `manifest.list.v2`) || contains(imageManifestMediaType, `image.index.v1`)) && imagePushedAt` < \`${CUTOFF_DATE}\`].{imageDigest: join(`=`, [`imageDigest`, imageDigest])}' \
--query 'imageDetails[?!imageTags && (contains(imageManifestMediaType, `manifest.list.v2`) || contains(imageManifestMediaType, `image.index.v1`)) && imagePushedAt < \`${CUTOFF_DATE}\`].{imageDigest: join(`=`, [`imageDigest`, imageDigest])}' \
--output text)

batch_delete "${IMAGE_DIGESTS}"
Expand Down

0 comments on commit b29f834

Please sign in to comment.