Skip to content

Commit

Permalink
Podman pull --all-tags shorthand option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jake Correnti committed Jul 14, 2022
1 parent 5c3eec5 commit c9693d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/podman/images/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-pull.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
11 changes: 11 additions & 0 deletions test/e2e/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c9693d3

Please sign in to comment.