mirror of https://github.com/containers/podman.git
rootless: always set XDG_RUNTIME_DIR
containers/image uses XDG_RUNTIME_DIR to locate the auth file. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1048 Approved by: mheon
This commit is contained in:
parent
77758a6c9f
commit
e38272047f
|
|
@ -217,6 +217,14 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {
|
||||||
if _, err := os.Stat(configPath); err != nil {
|
if _, err := os.Stat(configPath); err != nil {
|
||||||
foundConfig = false
|
foundConfig = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// containers/image uses XDG_RUNTIME_DIR to locate the auth file.
|
||||||
|
// So make sure the env variable is set.
|
||||||
|
err = os.Setenv("XDG_RUNTIME_DIR", GetRootlessRuntimeDir())
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "cannot set XDG_RUNTIME_DIR")
|
||||||
|
}
|
||||||
|
|
||||||
} else if _, err := os.Stat(OverrideConfigPath); err == nil {
|
} else if _, err := os.Stat(OverrideConfigPath); err == nil {
|
||||||
// Use the override configuration path
|
// Use the override configuration path
|
||||||
configPath = OverrideConfigPath
|
configPath = OverrideConfigPath
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue