Repository navigation
Add --additional-tag option to imgpkg push. #355
Description
Describe the problem/challenge you have
I need to be able to add multiple tags to an image when using imgpkg push -i. For example, I would use an explicit tag based on version or a sha, but at the same time still need the image tagged with latest. At present need to do two runs of imgpkg push with the same input.
imgpkg push --file . \
--image ghcr.io/${REPOSITORY}:sha-${REPOSITORY_SHA7} \
--registry-username=${{github.actor}} \
--registry-password=${{secrets.GITHUB_TOKEN}}
imgpkg push --file . \
--image ghcr.io/${REPOSITORY}:latest \
--registry-username=${{github.actor}} \
--registry-password=${{secrets.GITHUB_TOKEN}}
Running imgpkg push twice is inconvenient.
Describe the solution you'd like
Add an --additional-tag option for allowing one or more (list option more than once) tags to the image in addition to the primary tag in the image reference given to --image option.
Anything else you would like to add:
Since imgpkg push already adds a sha256-???.imgpkg tag in addition to the user tag, the mechanics should exist already to do this, so shouldn't be a huge problem.
The name for the option of --additional-tag is inspired by option of same name in skopeo used to add extra tags when copying images.
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help work on this issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsUnprioritized
Activity
joaopapereira commentedon Mar 28, 2022
Hello,
Push command is used both with single images and bundles. Is your idea to only have this particular flag to be available when you are doing
--imagepush?By your description, it does indeed sound like something that we can improve to help your use case.
GrahamDumpleton commentedon Mar 28, 2022
I could see this as being useful for bundles as well. Same argument, people may want something tagged as X.Y but still want latest as well for convenience. For development or experimentation using latest in this scenario would be fine so don't have to go work out what actual latest X.Y was. Not everything is production nor need production level guarantees around pinning versions.
github-actions commentedon May 8, 2022
This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.
GrahamDumpleton commentedon May 8, 2022
Still interested in this. Go away stale bot.
github-actions commentedon Jun 18, 2022
This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.
GrahamDumpleton commentedon Jun 18, 2022
Still interested in this. Go away stale bot.
phenixblue commentedon Aug 4, 2023
@joaopapereira Is anyone working on this? If not is this something I could work on? I don't think it would be too dissimilar from what I did for labels.
joaopapereira commentedon Aug 4, 2023
To the best of my knowledge, no one is working on it. Nevertheless, I just assigned it to you, so feel free to work on it.
This functionality should be added for both bundles and images. It will be roughly in the same area of code.
We only need to remember that even if you push an image/bundle with multiple tags, this story WILL NOT cover the copy of said tags when you execute
imgpkg copy. If that is something that people want in the future, we should create a separate issue to address it.phenixblue commentedon Aug 8, 2023
Ok, I have a PR up that I believe captures the intent described above.
One thing that I am unsure about is if/how output from the CLI should change. Listing the tags that get pushed seems like a given, but the way the existing output works, it prints the files/directories of the image/bundle (duplicated for each tag that gets pushed). Not a problem really, but not sure if that's something that needs to be changed.