Skip to content

Commit

Permalink
Pass io.Writer when pushing images/manifests from command line
Browse files Browse the repository at this point in the history
[NO NEW TESTS NEEDED]

Signed-off-by: Vladimir Kochnev <[email protected]>
  • Loading branch information
marshall-lee committed Aug 18, 2022
1 parent e48681e commit ec9508e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/podman/images/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ func imagePush(cmd *cobra.Command, args []string) error {
pushOptions.Password = creds.Password
}

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

if err := common.PrepareSigningPassphrase(&pushOptions.ImagePushOptions, pushOptions.SignPassphraseFileCLI); err != nil {
return err
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/podman/manifest/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io/ioutil"
"os"

"github.com/containers/common/pkg/auth"
"github.com/containers/common/pkg/completion"
Expand Down Expand Up @@ -122,6 +123,10 @@ func push(cmd *cobra.Command, args []string) error {
manifestPushOpts.Password = creds.Password
}

if !manifestPushOpts.Quiet {
manifestPushOpts.Writer = os.Stderr
}

if err := common.PrepareSigningPassphrase(&manifestPushOpts.ImagePushOptions, manifestPushOpts.SignPassphraseFileCLI); err != nil {
return err
}
Expand Down

0 comments on commit ec9508e

Please sign in to comment.