Skip to content

Commit

Permalink
Match Docker pull/push by defaulting to progress write to stdout
Browse files Browse the repository at this point in the history
Fixes: containers#21181

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jan 6, 2024
1 parent 1697a8b commit 89b3280
Show file tree
Hide file tree
Showing 3 changed files with 14 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 @@ -172,7 +172,7 @@ func imagePull(cmd *cobra.Command, args []string) error {
pullOptions.OciDecryptConfig = decConfig

if !pullOptions.Quiet {
pullOptions.Writer = os.Stderr
pullOptions.Writer = os.Stdout
}

// Let's do all the remaining Yoga in the API to prevent us from
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/images/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func imagePush(cmd *cobra.Command, args []string) error {
}

if !pushOptions.Quiet {
pushOptions.Writer = os.Stderr
pushOptions.Writer = os.Stdout
}

signingCleanup, err := common.PrepareSigning(&pushOptions.ImagePushOptions,
Expand Down
12 changes: 12 additions & 0 deletions test/e2e/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ var _ = Describe("Podman pull", func() {
Expect(session.ErrorToString()).To(ContainSubstring("unauthorized: access to the requested resource is not authorized"))
})

It("podman pull with tag all output to stdout", func() {
session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2:20200210"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session.ErrorToString()).To(BeEmpty())
Expect(session.OutputToString()).To(ContainSubstring("Trying to pull quay.io/libpod/testdigest_v2s2:20200210"))

session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2:20200210"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
})

It("podman pull with tag --quiet", func() {
session := podmanTest.Podman([]string{"pull", "-q", "quay.io/libpod/testdigest_v2s2:20200210"})
session.WaitWithDefaultTimeout()
Expand Down

0 comments on commit 89b3280

Please sign in to comment.