summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-08-17 21:43:47 +0000
committerGitHub <noreply@github.com>2022-08-17 21:43:47 +0000
commit188d8703070936f9de7a8e499f5af8ad5a41147d (patch)
treecaf680cdb95f80f2d7b25590dc41e1ee5eb6aa2d
parent5de215e1447af96ec2b199794cd425b75a2da08a (diff)
parent0dd2fcf715ec8a3ae8e15212289e5320e7cded19 (diff)
downloadpodman-188d8703070936f9de7a8e499f5af8ad5a41147d.tar.gz
podman-188d8703070936f9de7a8e499f5af8ad5a41147d.tar.bz2
podman-188d8703070936f9de7a8e499f5af8ad5a41147d.zip
Merge pull request #15362 from rhatdan/manifest1
Add podman manifest create -a. Alias for --amend:Docker compatibility
-rw-r--r--cmd/podman/manifest/create.go2
-rw-r--r--docs/source/markdown/podman-manifest-create.1.md2
-rw-r--r--test/e2e/manifest_test.go28
3 files changed, 19 insertions, 13 deletions
diff --git a/cmd/podman/manifest/create.go b/cmd/podman/manifest/create.go
index 0a0ea1d88..2ea40d832 100644
--- a/cmd/podman/manifest/create.go
+++ b/cmd/podman/manifest/create.go
@@ -42,7 +42,7 @@ func init() {
})
flags := createCmd.Flags()
flags.BoolVar(&manifestCreateOpts.All, "all", false, "add all of the lists' images if the images to add are lists")
- flags.BoolVar(&manifestCreateOpts.Amend, "amend", false, "modify an existing list if one with the desired name already exists")
+ flags.BoolVarP(&manifestCreateOpts.Amend, "amend", "a", false, "modify an existing list if one with the desired name already exists")
flags.BoolVar(&manifestCreateOpts.Insecure, "insecure", false, "neither require HTTPS nor verify certificates when accessing the registry")
_ = flags.MarkHidden("insecure")
flags.BoolVar(&manifestCreateOpts.TLSVerifyCLI, "tls-verify", true, "require HTTPS and verify certificates when accessing the registry")
diff --git a/docs/source/markdown/podman-manifest-create.1.md b/docs/source/markdown/podman-manifest-create.1.md
index f2aac6069..06a24da2b 100644
--- a/docs/source/markdown/podman-manifest-create.1.md
+++ b/docs/source/markdown/podman-manifest-create.1.md
@@ -22,7 +22,7 @@ If any of the images which should be added to the new list or index are
themselves lists or indexes, add all of their contents. By default, only one
image from such a list will be added to the newly-created list or index.
-#### **--amend**
+#### **--amend**, **-a**
If a manifest list named *listnameorindexname* already exists, modify the
preexisting list instead of exiting with an error. The contents of
diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go
index 145a016ea..1c4aad710 100644
--- a/test/e2e/manifest_test.go
+++ b/test/e2e/manifest_test.go
@@ -46,17 +46,23 @@ var _ = Describe("Podman manifest", func() {
processTestResult(f)
})
It("create w/o image", func() {
- session := podmanTest.Podman([]string{"manifest", "create", "foo"})
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
-
- session = podmanTest.Podman([]string{"manifest", "create", "foo"})
- session.WaitWithDefaultTimeout()
- Expect(session).To(ExitWithError())
-
- session = podmanTest.Podman([]string{"manifest", "create", "--amend", "foo"})
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
+ for _, amend := range []string{"--amend", "-a"} {
+ session := podmanTest.Podman([]string{"manifest", "create", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"manifest", "create", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).To(ExitWithError())
+
+ session = podmanTest.Podman([]string{"manifest", "create", amend, "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"manifest", "rm", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ }
})
It("create w/ image", func() {