Skip to content

Using additional_tags but no tag on the source configuration does not push the image with the latest tag in ECR #347

Open
@idavidmcdonald

Description

@idavidmcdonald

Describe the bug

I have been pushing images to ECR and setting a tag in additional_tags in the put step.

My source configuration doesn't set the tag value. According to the README, the default is latest.

This results in an image being pushed to only the tag in my additional_tags file.

Given that the default value for tag is latest, I added to my source configuration tag: latest and expected to see no behaviour change. However, instead I now see the behaviour of pushing images to both the tag in my additional_tags file AND also the latest tag.

There is a chance I've gotten confused or misread something or gotten something wrong, apologies if that is the case. However I think it means that either

  • the readme was misleading as there is no default value for tag and that is why latest was not being pushed, or
  • there is an issue when pushing images to ECR (I haven't tested other registries) that it is not pushing images to the default source configuration tag as well

I think it may be the later case, due to a previous comment in a related issue which was about a desire not to push to the tag set in the source configuration which was deemed to not be the direction wanted.

Reproduction steps

- name: source-without-tag-value-set
  type: registry-image
  icon: aws
  source:
    repository: my-repo
    aws_region: eu-west-1
    aws_access_key_id: access-key-id
    aws_secret_access_key: secret-access-key
    aws_session_token: session-token
    - put: api-ecr
      params:
        image: image/image.tar
        additional_tags: api-main/image-tag.txt

where api-main/image-tag.txt is a file with text some-random-tag

The output in Concourse says pushing tag(s) some-random-tag

Expected behavior

Although I'm not 100% as the readme isn't explicit, I think I expected to see the output in Concourse saying pushing tag(s) latest, some-random-tag

Additional context

I actually like to ability to not push to latest everytime I push an image to ECR (we have an immutable ECR repository and pushing to latest everytime will cause it to error when pushing images)...

However, I don't mind what the intended behaviour is (you will know best) but I just wanted to make sure that the expected behaviour is happening and the readme clearly communicates that.

Thank you for your time :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions