summaryrefslogtreecommitdiff
path: root/cmd/podman/shared
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-08-12 14:11:53 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-08-12 14:11:53 -0400
commitd27e71374e89b3c88b486f8a7015185c9fe13ea9 (patch)
tree45064631551c7aa2fb13dd6b08c3ac0e4547c344 /cmd/podman/shared
parent9bee6907a5d867ab866374c6c7d8a45e3fa705da (diff)
downloadpodman-d27e71374e89b3c88b486f8a7015185c9fe13ea9.tar.gz
podman-d27e71374e89b3c88b486f8a7015185c9fe13ea9.tar.bz2
podman-d27e71374e89b3c88b486f8a7015185c9fe13ea9.zip
Use GetRuntimeDir to setup auth.json for login
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/shared')
-rw-r--r--cmd/podman/shared/funcs.go8
1 files changed, 5 insertions, 3 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 ""
}