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

Add support to handle additional OCI tags from user input #553

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

phenixblue
Copy link
Contributor

@phenixblue phenixblue commented Aug 6, 2023

These changes add the ability to specify additional OCI tags to be pushed when using imgpkg.

It adds the --additional-tags flag to imgpkg push command and allows the user to specify a comma separated list of additional tags, or the flag can be reused multiple times. This flag functions for both images and bundles.

Comma Separated List

$ ./imgpkg push -i jmsearcy/test-imgpkg-image -f ./pkg/imgpkg/cmd/test_assets/image_with_config --additional-tags 1.0.1,1.0.2

TEST - REGISTRY: index.docker.io
TEST - REPOSITORY: jmsearcy/test-imgpkg-image
TEST - NAME: index.docker.io/jmsearcy/test-imgpkg-image:latest
TEST - TAG: latest
dir: .
file: config.yml
dir: .
file: config.yml
dir: .
file: config.yml
Tags: 1.0.1, 1.0.2, latest
Pushed:
index.docker.io/jmsearcy/test-imgpkg-image@sha256:7b77aebdd49c9d3babf251703ce8cc660cf0fd040aa5d29f262d2084e2d59e8a

Succeeded

Multiple flags

$ ./imgpkg push -i jmsearcy/test-imgpkg-image -f ./pkg/imgpkg/cmd/test_assets/image_with_config --additional-tags 1.0.1 --additional-tags 1.0.2

TEST - REGISTRY: index.docker.io
TEST - REPOSITORY: jmsearcy/test-imgpkg-image
TEST - NAME: index.docker.io/jmsearcy/test-imgpkg-image:latest
TEST - TAG: latest
dir: .
file: config.yml
dir: .
file: config.yml
dir: .
file: config.yml
Tags: 1.0.1, 1.0.2, latest
Pushed:
index.docker.io/jmsearcy/test-imgpkg-image@sha256:7b77aebdd49c9d3babf251703ce8cc660cf0fd040aa5d29f262d2084e2d59e8a

Succeeded

Fixes #355

@phenixblue phenixblue had a problem deploying to TanzuNet Registry Dev e2e August 6, 2023 22:15 — with GitHub Actions Failure
@phenixblue phenixblue had a problem deploying to TanzuNet Registry Dev e2e August 6, 2023 22:15 — with GitHub Actions Failure
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e August 6, 2023 22:57 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to GCR e2e August 6, 2023 22:57 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to GCR e2e September 13, 2023 01:28 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e September 13, 2023 01:28 — with GitHub Actions Inactive
Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nitpicks and a question.
Do you think it would also make sense to add 1 end 2 end test to ensure all is good?

pkg/imgpkg/bundle/contents.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/bundle/contents.go Outdated Show resolved Hide resolved
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e September 13, 2023 21:08 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e September 13, 2023 22:37 — with GitHub Actions Inactive
@phenixblue
Copy link
Contributor Author

I'm not familiar with the end-to-end tests. Can you point me at an example or describe what that might look like?

@phenixblue phenixblue temporarily deployed to GCR e2e September 14, 2023 14:21 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e September 14, 2023 14:21 — with GitHub Actions Inactive
@joaopapereira
Copy link
Member

I'm not familiar with the end-to-end tests. Can you point me at an example or describe what that might look like?

Maybe we can use https://github.com/carvel-dev/imgpkg/blob/develop/test/e2e/push_test.go as a base. Just making sure that the correct tags are added to the file and also in the registry (https://github.com/carvel-dev/imgpkg/blob/develop/test/e2e/copy_from_lockfiles_test.go#L226), this last example is on how can we check that multiple tags are present in the registry but the rest of the test is a copy test which we do not want to do.

@phenixblue
Copy link
Contributor Author

Ok, I'll take a look and give it a shot

@phenixblue
Copy link
Contributor Author

I've not been able to look at this much in the past few months due to a job change, but will be getting back to it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Add --additional-tag option to imgpkg push.
2 participants