From 89b328088af51c9c89d637ba1e2bf1d200fd8005 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sat, 6 Jan 2024 06:26:33 -0500 Subject: [PATCH] Match Docker pull/push by defaulting to progress write to stdout Fixes: https://github.com/containers/podman/issues/21181 Signed-off-by: Daniel J Walsh --- cmd/podman/images/pull.go | 2 +- cmd/podman/images/push.go | 2 +- test/e2e/pull_test.go | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index 2bcfd2055c..b7f5936be1 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -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 diff --git a/cmd/podman/images/push.go b/cmd/podman/images/push.go index 168411328f..a482897e36 100644 --- a/cmd/podman/images/push.go +++ b/cmd/podman/images/push.go @@ -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, diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go index 465786917f..a102a4447a 100644 --- a/test/e2e/pull_test.go +++ b/test/e2e/pull_test.go @@ -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()