summaryrefslogtreecommitdiff
path: root/cmd/podman/push.go
diff options
context:
space:
mode:
authorTomSweeneyRedHat <tsweeney@redhat.com>2018-02-03 18:25:18 -0500
committerTomSweeneyRedHat <tsweeney@redhat.com>2018-02-06 09:29:23 -0500
commitbb37c11651b9a01ff9b5191eb5072cdf0db83a51 (patch)
tree3854db36aecff70a103dd176d97062035a7415e8 /cmd/podman/push.go
parentbf00c976dd7509b7d84d1fa5254f1ac26fc494e5 (diff)
downloadpodman-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/push.go')
-rw-r--r--cmd/podman/push.go18
1 files changed, 4 insertions, 14 deletions
diff --git a/cmd/podman/push.go b/cmd/podman/push.go
index 69d6e6629..2f0d73ffa 100644
--- a/cmd/podman/push.go
+++ b/cmd/podman/push.go
@@ -13,8 +13,8 @@ import (
"github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod"
"github.com/projectatomic/libpod/libpod/common"
+ "github.com/projectatomic/libpod/pkg/util"
"github.com/urfave/cli"
- "golang.org/x/crypto/ssh/terminal"
)
var (
@@ -97,25 +97,15 @@ func pushCmd(c *cli.Context) error {
}
}
- registryCredsString := c.String("creds")
certPath := c.String("cert-dir")
skipVerify := !c.BoolT("tls-verify")
removeSignatures := c.Bool("remove-signatures")
signBy := c.String("sign-by")
- if registryCredsString != "" {
- creds, err := common.ParseRegistryCreds(registryCredsString)
+ 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
}