mirror of
https://github.com/containers/podman.git
synced 2025-06-28 22:53:21 +08:00
Allow podman manigest push --purge|-p as alias for --rm
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -47,6 +47,8 @@ func init() {
|
|||||||
flags := pushCmd.Flags()
|
flags := pushCmd.Flags()
|
||||||
flags.BoolVar(&manifestPushOpts.Rm, "rm", false, "remove the manifest list if push succeeds")
|
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.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"
|
authfileFlagName := "authfile"
|
||||||
flags.StringVar(&manifestPushOpts.Authfile, authfileFlagName, auth.GetDefaultAuthFile(), "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override")
|
flags.StringVar(&manifestPushOpts.Authfile, authfileFlagName, auth.GetDefaultAuthFile(), "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override")
|
||||||
|
@ -23,8 +23,6 @@ func AliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
|
|||||||
name = "ns"
|
name = "ns"
|
||||||
case "storage":
|
case "storage":
|
||||||
name = "external"
|
name = "external"
|
||||||
case "purge":
|
|
||||||
name = "rm"
|
|
||||||
case "notruncate":
|
case "notruncate":
|
||||||
name = "no-trunc"
|
name = "no-trunc"
|
||||||
case "override-arch":
|
case "override-arch":
|
||||||
|
@ -464,6 +464,10 @@ var _ = Describe("Podman manifest", func() {
|
|||||||
session = podmanTest.Podman([]string{"manifest", "push", "--purge", "foo", "dir:" + dest})
|
session = podmanTest.Podman([]string{"manifest", "push", "--purge", "foo", "dir:" + dest})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
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 = podmanTest.Podman([]string{"images", "-q", "foo"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
|
Reference in New Issue
Block a user