Pass io.Writer when pushing images/manifests from command line

[NO NEW TESTS NEEDED]

Signed-off-by: Vladimir Kochnev <hashtable@yandex.ru>
This commit is contained in:
Vladimir Kochnev 2022-08-17 03:56:25 +03:00
parent e48681e600
commit ec9508ea17
No known key found for this signature in database
GPG Key ID: 62CA5C366E54F885
2 changed files with 9 additions and 0 deletions

View File

@ -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
}

View File

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io/ioutil"
"os"
"github.com/containers/common/pkg/auth"
"github.com/containers/common/pkg/completion"
@ -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
}