CircleCI-Public / aws-ecr-orb

CircleCI orb for interacting with Amazon's Elastic Container Registry (ECR)
https://circleci.com/orbs/registry/orb/circleci/aws-ecr
MIT License
80 stars 142 forks source link

Only list images when their use case is not skipped #363

Closed georgantasp closed 3 weeks ago

georgantasp commented 1 month ago

Checklist

Motivation, issues

My CI AWS profile is given an aws managed policy which does not have ecr:ListImages permission. EC2InstanceProfileForImageBuilderECRContainerBuilds

Description

The tag_image command has a flag to skip_when_tags_exist (default false). When the flag is not set, there is no use for the ListImages output.

marboledacci commented 1 month ago

If you look at line 17 that value is then used to do the validation and tag or not, so this implementation would break that.

georgantasp commented 1 month ago

@marboledacci you're right, I let the double negative confuse me. I pushed a fix to make it make sense. Now, the EXISTING_TAGS is only set when AWS_ECR_BOOL_SKIP_WHEN_TAGS_EXIST is set to 1.