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

[wip] Podman push --all-tags option #14949

Closed
wants to merge 1 commit into from

Conversation

byarbrough
Copy link

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?

Adds option to push all tags for a given image. When doing so, do not specify a tag after the destination.

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]>
@byarbrough
Copy link
Author

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.

@rhatdan
Copy link
Member

rhatdan commented Jul 15, 2022

Yes we want this feature in Podman. We don't want to tell users to download and install another tool when they have Podman.

@rhatdan rhatdan changed the title Podman push --all-tags option [wip] Podman push --all-tags option Jul 15, 2022
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 15, 2022
@@ -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")
Copy link
Member

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 {
Copy link
Member

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.

Copy link
Author

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 15, 2022

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 15, 2022
@rhatdan
Copy link
Member

rhatdan commented Jul 15, 2022

Your tests should be comparing --all=false to --all=true.
@vrothberg PTAL

Copy link
Member

@vrothberg vrothberg left a 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 and pkg/bindings for the client and pkg/api for the server (including the swagger docs in pkg/api/server and the endpoint in pkg/api/handlers).

Feel free to ping us here or on IRC/Matrix if you have any questions.

byarbrough added a commit to byarbrough/containers-common that referenced this pull request Jul 21, 2022
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 added a commit to byarbrough/containers-common that referenced this pull request Jul 21, 2022
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]>
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 23, 2022
@openshift-merge-robot
Copy link
Collaborator

@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.

byarbrough added a commit to byarbrough/containers-common that referenced this pull request Jul 28, 2022
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]>
@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Aug 23, 2022

@byarbrough Are you still working on this?
@vrothberg time to take this over?

@byarbrough
Copy link
Author

This is blocked by the PR containers/common#1099
That one is turning out to be a larger lift than expected - especially now with the likely need to add some unit tests to verify that all the correct images are being identified.

@github-actions github-actions bot removed the stale-pr label Aug 24, 2022
@byarbrough byarbrough closed this Sep 22, 2022
@byarbrough byarbrough mentioned this pull request Sep 22, 2022
69 tasks
@jakecorrenti
Copy link
Member

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

@rhatdan
Copy link
Member

rhatdan commented Sep 23, 2022

SGTM

@rhatdan
Copy link
Member

rhatdan commented Sep 23, 2022

@jakecorrenti Take over the containers/common PR and get it merged first.

@jakecorrenti
Copy link
Member

sounds good

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants