Skip to content

Commit

Permalink
Merge pull request #16466 from rhatdan/manifest1
Browse files Browse the repository at this point in the history
Allow podman manifest push --purge|-p as alias for --rm
  • Loading branch information
cevich committed Nov 11, 2022
2 parents 6555e69 + d9acead commit 653ac77
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
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"
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 @@ -487,6 +487,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

0 comments on commit 653ac77

Please sign in to comment.