summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-29 07:29:36 -0700
committerGitHub <noreply@github.com>2019-04-29 07:29:36 -0700
commit4e5b39650d89e6463bcfb97ea8b7054c966e9008 (patch)
tree0f6405949f383529de0d93ead00b05b5441ab42c /cmd/podman
parent627bfd07d2e7650967e3eef206446211bf07db3d (diff)
parent6f08e6c3d12d0b4de2a1b9281042e6b3cce28733 (diff)
downloadpodman-4e5b39650d89e6463bcfb97ea8b7054c966e9008.tar.gz
podman-4e5b39650d89e6463bcfb97ea8b7054c966e9008.tar.bz2
podman-4e5b39650d89e6463bcfb97ea8b7054c966e9008.zip
Merge pull request #3015 from QiWang19/credsH
fix login supports credHelpers config
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/login.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/podman/login.go b/cmd/podman/login.go
index 589255683..6bf148cca 100644
--- a/cmd/podman/login.go
+++ b/cmd/podman/login.go
@@ -11,6 +11,7 @@ import (
"github.com/containers/image/types"
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/libpod/image"
+ "github.com/docker/docker-credential-helpers/credentials"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"golang.org/x/crypto/ssh/terminal"
@@ -90,7 +91,8 @@ func loginCmd(c *cliconfig.LoginValues) error {
// username of user logged in to server (if one exists)
userFromAuthFile, passFromAuthFile, err := config.GetAuthentication(sc, server)
- if err != nil {
+ // Do not return error if no credentials found in credHelpers, new credentials will be stored by config.SetAuthentication
+ if err != nil && err != credentials.NewErrCredentialsNotFound() {
return errors.Wrapf(err, "error reading auth file")
}