diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-19 21:16:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 21:16:06 +0200 |
commit | 890378e3f7fe93bd40322445e31c169fa03d8bf7 (patch) | |
tree | 3ca16c20e44dd94d6716e903a493e04a9b3fcdb6 /cmd | |
parent | 33906a4c4013bfe12f058526ad0e3b697d2ec033 (diff) | |
parent | d27e71374e89b3c88b486f8a7015185c9fe13ea9 (diff) | |
download | podman-890378e3f7fe93bd40322445e31c169fa03d8bf7.tar.gz podman-890378e3f7fe93bd40322445e31c169fa03d8bf7.tar.bz2 podman-890378e3f7fe93bd40322445e31c169fa03d8bf7.zip |
Merge pull request #3760 from rhatdan/auth
Use GetRuntimeDir to setup auth.json for login
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/shared/funcs.go | 8 | ||||
-rw-r--r-- | cmd/podman/varlink.go | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/cmd/podman/shared/funcs.go b/cmd/podman/shared/funcs.go index 2ceb9cdcb..bb4eed1e3 100644 --- a/cmd/podman/shared/funcs.go +++ b/cmd/podman/shared/funcs.go @@ -6,6 +6,7 @@ import ( "path/filepath" "strings" + "github.com/containers/libpod/pkg/util" "github.com/google/shlex" ) @@ -13,13 +14,14 @@ func GetAuthFile(authfile string) string { if authfile != "" { return authfile } + authfile = os.Getenv("REGISTRY_AUTH_FILE") if authfile != "" { return authfile } - runtimeDir := os.Getenv("XDG_RUNTIME_DIR") - if runtimeDir != "" { - return filepath.Join(runtimeDir, "containers/auth.json") + + if runtimeDir, err := util.GetRuntimeDir(); err == nil { + return filepath.Join(runtimeDir, "auth.json") } return "" } diff --git a/cmd/podman/varlink.go b/cmd/podman/varlink.go index 5f89534be..cd21e3574 100644 --- a/cmd/podman/varlink.go +++ b/cmd/podman/varlink.go @@ -53,7 +53,7 @@ func init() { func varlinkCmd(c *cliconfig.VarlinkValues) error { varlinkURI := adapter.DefaultAddress if rootless.IsRootless() { - xdg, err := util.GetRootlessRuntimeDir() + xdg, err := util.GetRuntimeDir() if err != nil { return err } |