Support push --all-tags to push all tags#4627
Support push --all-tags to push all tags#4627yashkukrecha wants to merge 1 commit intocontainerd:mainfrom
push --all-tags to push all tags#4627Conversation
| var tagRefs []string | ||
| for _, img := range imgList { | ||
| if strings.HasPrefix(img.Name, repo+":") { | ||
| tagRefs = append(tagRefs, img.Name) | ||
| } | ||
| } |
There was a problem hiding this comment.
The prefix matching is too broad and can match unintended images. For example, if repository is mytest , it will correctly match mytest:latest. But it will also incorrectly match mytestrepo:latest
There was a problem hiding this comment.
If repo is mytest and img.Name is mytestrepo:latest, the strings would not match. The HasPrefix method would check if mytest: is a prefix of mytestrepo:latest, which is false.
| if err != nil { | ||
| return err | ||
| // Handle --all-tags | ||
| if options.AllTags { |
There was a problem hiding this comment.
Currently, iff user runs nerdctl push myrepo:v1 --all-tags , the tag :v1 is silently ignored. It should return an error like docker does: https://github.com/docker/cli/blob/1a1a4fc478fcd0131f3f3225b98faa5bd16dc51e/cli/command/image/push.go#L102
e4b16ed to
9a3cfc5
Compare
Signed-off-by: Yash Kukrecha <ykukrecha@gmail.com>
9a3cfc5 to
3425f04
Compare
|
Hi, the only consistent failure I'm seeing is |
This PR adds Docker-compatible --all-tags support and fixes a SOCI regression when pushing multiple tags of the same image.
Key changes:
--all-tagsflag forimage pushFixes #3751