From c9693d3b440d6a4f76823cad0959056201775d8d Mon Sep 17 00:00:00 2001 From: Jake Correnti Date: Wed, 13 Jul 2022 21:41:16 -0400 Subject: [PATCH] Podman pull --all-tags shorthand option I added the shorthand option for `podman pull --all-tags`. Like Docker, Podman can now do `podman pull -a`. Signed-off-by: Jake Correnti --- cmd/podman/images/pull.go | 2 +- docs/source/markdown/podman-pull.1.md | 2 +- test/e2e/pull_test.go | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index 6e3ec15171b8..8211ceba591e 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -77,7 +77,7 @@ func init() { func pullFlags(cmd *cobra.Command) { flags := cmd.Flags() - flags.BoolVar(&pullOptions.AllTags, "all-tags", false, "All tagged images in the repository will be pulled") + flags.BoolVarP(&pullOptions.AllTags, "all-tags", "a", false, "All tagged images in the repository will be pulled") credsFlagName := "creds" flags.StringVar(&pullOptions.CredentialsCLI, credsFlagName, "", "`Credentials` (USERNAME:PASSWORD) to use for authenticating to a registry") diff --git a/docs/source/markdown/podman-pull.1.md b/docs/source/markdown/podman-pull.1.md index 928bbc6fed6e..99e227226567 100644 --- a/docs/source/markdown/podman-pull.1.md +++ b/docs/source/markdown/podman-pull.1.md @@ -43,7 +43,7 @@ $ podman pull oci-archive:/tmp/myimage ``` ## OPTIONS -#### **--all-tags** +#### **--all-tags**, **-a** All tagged images in the repository will be pulled. diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go index 04b7a280d829..a8b8b9c8b97a 100644 --- a/test/e2e/pull_test.go +++ b/test/e2e/pull_test.go @@ -110,6 +110,17 @@ var _ = Describe("Podman pull", func() { Expect(len(session.OutputToStringArray())).To(BeNumerically(">=", 2), "Expected at least two images") }) + It("podman pull check all tags shorthand", func() { + session := podmanTest.Podman([]string{"pull", "-a", "quay.io/libpod/testdigest_v2s2"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + session = podmanTest.Podman([]string{"images"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(len(session.OutputToStringArray())).To(BeNumerically(">=", 2), "Expected at least two images") + }) + It("podman pull from docker with nonexistent --authfile", func() { session := podmanTest.Podman([]string{"pull", "--authfile", "/tmp/nonexistent", ALPINE}) session.WaitWithDefaultTimeout()