diff options
author | TomSweeneyRedHat <tsweeney@redhat.com> | 2018-02-03 18:25:18 -0500 |
---|---|---|
committer | TomSweeneyRedHat <tsweeney@redhat.com> | 2018-02-06 09:29:23 -0500 |
commit | bb37c11651b9a01ff9b5191eb5072cdf0db83a51 (patch) | |
tree | 3854db36aecff70a103dd176d97062035a7415e8 /cmd/podman/pull.go | |
parent | bf00c976dd7509b7d84d1fa5254f1ac26fc494e5 (diff) | |
download | podman-bb37c11651b9a01ff9b5191eb5072cdf0db83a51.tar.gz podman-bb37c11651b9a01ff9b5191eb5072cdf0db83a51.tar.bz2 podman-bb37c11651b9a01ff9b5191eb5072cdf0db83a51.zip |
Change un/pwd handling to match Buildah's
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Diffstat (limited to 'cmd/podman/pull.go')
-rw-r--r-- | cmd/podman/pull.go | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go index 5726b20f1..c19e6715b 100644 --- a/cmd/podman/pull.go +++ b/cmd/podman/pull.go @@ -1,16 +1,14 @@ package main import ( - "fmt" "io" "os" - "golang.org/x/crypto/ssh/terminal" - "github.com/containers/image/types" "github.com/pkg/errors" "github.com/projectatomic/libpod/libpod" "github.com/projectatomic/libpod/libpod/common" + "github.com/projectatomic/libpod/pkg/util" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) @@ -80,19 +78,11 @@ func pullCmd(c *cli.Context) error { image := args[0] var registryCreds *types.DockerAuthConfig - if c.String("creds") != "" { - creds, err := common.ParseRegistryCreds(c.String("creds")) + + if c.IsSet("creds") { + creds, err := util.ParseRegistryCreds(c.String("creds")) if err != nil { - if err == common.ErrNoPassword { - fmt.Print("Password: ") - password, err := terminal.ReadPassword(0) - if err != nil { - return errors.Wrapf(err, "could not read password from terminal") - } - creds.Password = string(password) - } else { - return err - } + return err } registryCreds = creds } |