summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-05-21 15:54:26 -0400
committerGitHub <noreply@github.com>2019-05-21 15:54:26 -0400
commitcec56b0075eeec6a8cdfba3138dec32fdcd36b47 (patch)
tree6b129e2b8f58e0a46b8d25cd4459bb6e3c9436f7 /cmd/podman
parente6277b1a2dedf8a4d80a270ddac0be4c22ed3e6d (diff)
parent1d505f6875d27dccafb777853a51045f82888f00 (diff)
downloadpodman-cec56b0075eeec6a8cdfba3138dec32fdcd36b47.tar.gz
podman-cec56b0075eeec6a8cdfba3138dec32fdcd36b47.tar.bz2
podman-cec56b0075eeec6a8cdfba3138dec32fdcd36b47.zip
Merge pull request #3168 from rhatdan/vendor
Update vendor of buildah and containers/images
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/login.go23
1 files changed, 8 insertions, 15 deletions
diff --git a/cmd/podman/login.go b/cmd/podman/login.go
index 6bf148cca..9f9631d0d 100644
--- a/cmd/podman/login.go
+++ b/cmd/podman/login.go
@@ -74,21 +74,6 @@ func loginCmd(c *cliconfig.LoginValues) error {
sc.DockerCertPath = c.CertDir
}
- if c.Flag("get-login").Changed {
- user, err := config.GetUserLoggedIn(sc, server)
-
- if err != nil {
- return errors.Wrapf(err, "unable to check for login user")
- }
-
- if user == "" {
- return errors.Errorf("not logged into %s", server)
- }
-
- fmt.Printf("%s\n", user)
- return nil
- }
-
// username of user logged in to server (if one exists)
userFromAuthFile, passFromAuthFile, err := config.GetAuthentication(sc, server)
// Do not return error if no credentials found in credHelpers, new credentials will be stored by config.SetAuthentication
@@ -96,6 +81,14 @@ func loginCmd(c *cliconfig.LoginValues) error {
return errors.Wrapf(err, "error reading auth file")
}
+ if c.Flag("get-login").Changed {
+ if userFromAuthFile == "" {
+ return errors.Errorf("not logged into %s", server)
+ }
+ fmt.Printf("%s\n", userFromAuthFile)
+ return nil
+ }
+
ctx := getContext()
password := c.Password