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 <jcorrenti13@gmail.com>
This commit is contained in:
Jake Correnti
2022-07-13 21:41:16 -04:00
committed by Matthew Heon
parent f07d2bac4b
commit 53edd9b654
3 changed files with 11 additions and 2 deletions

View File

@ -77,7 +77,7 @@ func init() {
func pullFlags(cmd *cobra.Command) { func pullFlags(cmd *cobra.Command) {
flags := cmd.Flags() 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" credsFlagName := "creds"
flags.StringVar(&pullOptions.CredentialsCLI, credsFlagName, "", "`Credentials` (USERNAME:PASSWORD) to use for authenticating to a registry") flags.StringVar(&pullOptions.CredentialsCLI, credsFlagName, "", "`Credentials` (USERNAME:PASSWORD) to use for authenticating to a registry")

View File

@ -43,7 +43,7 @@ $ podman pull oci-archive:/tmp/myimage
``` ```
## OPTIONS ## OPTIONS
#### **--all-tags** #### **--all-tags**, **-a**
All tagged images in the repository will be pulled. All tagged images in the repository will be pulled.

View File

@ -108,6 +108,15 @@ var _ = Describe("Podman pull", func() {
session.WaitWithDefaultTimeout() session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0)) Expect(session).Should(Exit(0))
Expect(len(session.OutputToStringArray())).To(BeNumerically(">=", 2), "Expected at least two images") Expect(len(session.OutputToStringArray())).To(BeNumerically(">=", 2), "Expected at least two images")
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() { It("podman pull from docker with nonexistent --authfile", func() {