-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[wip] Podman push --all-tags option #14949
Conversation
Task for containers#14917 Podman will now push all tags for a given image when -a or --all-tags is specified. Signed-off-by: byarbrough <[email protected]>
This ended up being much more complicated than simply adding the flag. It required multiple modifications to some structs, as well as some new checks when a Push is happening. The preexisting All boolean didn't do anything. IMHO this is the sort of complexity that should be left to tools like Skopeo or Buildah since they are purpose built for creating and moving a large numbers of tags. I really won't be offended if this is not merged. I couldn't find any issues that mention this as a requested feature. But if we truly want to "alias docker" then I guess this flag would be required. |
Yes we want this feature in Podman. We don't want to tell users to download and install another tool when they have Podman. |
@@ -73,8 +73,8 @@ func init() { | |||
func pushFlags(cmd *cobra.Command) { | |||
flags := cmd.Flags() | |||
|
|||
// For now default All flag to true, for pushing of manifest lists | |||
pushOptions.All = true | |||
flags.BoolVarP(&pushOptions.All, "all-tags", "a", false, "Push all tagged images in the repository") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should still be defaulted to true.
@@ -36,6 +38,36 @@ func (r *Runtime) Push(ctx context.Context, source, destination string, options | |||
return nil, err | |||
} | |||
|
|||
// If specified to push all tags, look them up | |||
if options.AllTags { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can not make changes in vendored directory. You need to open a PR against containers/common to get this patch merged and then vendor it into Podman.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I was wondering what that was all about. I'll get that done.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: byarbrough, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Your tests should be comparing --all=false to --all=true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing!
A couple of additional comments:
- Please add your real name to the Signed-off-by field in the commit message. The reasoning is explained in the contributing guidelines.
- As Dan mentioned, the plumbing in
libimage
must be done in a separate PR in containers/common. Once the PR there is merged, you can vendor the changes along with this PR here. - The plumbing for the remote client must be done as well. This includes
podman-remote
andpkg/bindings
for the client andpkg/api
for the server (including the swagger docs inpkg/api/server
and the endpoint inpkg/api/handlers
).
Feel free to ping us here or on IRC/Matrix if you have any questions.
This seeks to mirror `docker push --all-tags IMAGE`. Because tags are appended to the destination, this will only work with the docker transport. Otherwise you'd get directories overwriting or with weird names. Also note that if AllTags is true then the user must provide the name of the image only; providing a tag will crash. Docker has this behavior: ``` tag can't be used with --all-tags/-a ``` Requirement for containers/podman#14949 ``` Signed-off-by: Brian Yarbrough [email protected] ```
This seeks to mirror `docker push --all-tags IMAGE`. Because tags are appended to the destination, this will only work with the docker transport. Otherwise you'd get directories overwriting or with weird names. Also note that if AllTags is true then the user must provide the name of the image only; providing a tag will crash. Docker has this behavior: ``` tag can't be used with --all-tags/-a ``` Requirement for containers/podman#14949 Signed-off-by: Brian Yarbrough <[email protected]>
@byarbrough: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This seeks to mirror `docker push --all-tags IMAGE`. Because tags are appended to the destination, this will only work with the docker transport. Otherwise you'd get directories overwriting or with weird names. Also note that if AllTags is true then the user must provide the name of the image only; providing a tag will crash. Docker has this behavior: ``` tag can't be used with --all-tags/-a ``` Requirement for containers/podman#14949 Signed-off-by: Brian Yarbrough <[email protected]>
A friendly reminder that this PR had no activity for 30 days. |
@byarbrough Are you still working on this? |
This is blocked by the PR containers/common#1099 |
This might be a bit over my head, but if it's not time sensitive I would like to take a whirl at this @rhatdan @vrothberg |
SGTM |
@jakecorrenti Take over the containers/common PR and get it merged first. |
sounds good |
Task for #14917
Podman will now push all tags for a given image
when -a or --all-tags is specified.
Signed-off-by: Brian Yarbrough[email protected]
Does this PR introduce a user-facing change?