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

Allow podman manifest push --purge|-p as alias for --rm #16466

Merged
merged 1 commit into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/podman/manifest/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func init() {
flags := pushCmd.Flags()
flags.BoolVar(&manifestPushOpts.Rm, "rm", false, "remove the manifest list if push succeeds")
flags.BoolVar(&manifestPushOpts.All, "all", true, "also push the images in the list")
flags.BoolVarP(&manifestPushOpts.Rm, "purge", "p", false, "remove the local manifest list after push")
_ = flags.MarkHidden("purge")

authfileFlagName := "authfile"
flags.StringVar(&manifestPushOpts.Authfile, authfileFlagName, auth.GetDefaultAuthFile(), "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override")
Expand Down
2 changes: 0 additions & 2 deletions cmd/podman/utils/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ func AliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
name = "ns"
case "storage":
name = "external"
case "purge":
name = "rm"
Luap99 marked this conversation as resolved.
Show resolved Hide resolved
case "notruncate":
name = "no-trunc"
case "override-arch":
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ var _ = Describe("Podman manifest", func() {
session = podmanTest.Podman([]string{"manifest", "push", "--purge", "foo", "dir:" + dest})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
session = podmanTest.Podman([]string{"manifest", "push", "-p", "foo", "dir:" + dest})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(125))
Expect(session.ErrorToString()).To(ContainSubstring("retrieving local image from image name foo: foo: image not known"))
session = podmanTest.Podman([]string{"images", "-q", "foo"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expand Down