mirror of
https://github.com/containers/podman.git
synced 2025-05-23 10:07:33 +08:00
runtime: change rootless data storage default path
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #936 Approved by: rhatdan
This commit is contained in:

committed by
Atomic Bot

parent
3306d3e120
commit
6f3208b599
@ -25,16 +25,15 @@ func GetRootlessStorageOpts() (storage.StoreOptions, error) {
|
|||||||
|
|
||||||
opts.RunRoot = filepath.Join(libpod.GetRootlessRuntimeDir(), "run")
|
opts.RunRoot = filepath.Join(libpod.GetRootlessRuntimeDir(), "run")
|
||||||
|
|
||||||
dataDir := os.Getenv("XDG_DATA_DIR")
|
dataDir := os.Getenv("XDG_DATA_HOME")
|
||||||
if dataDir != "" {
|
if dataDir == "" {
|
||||||
opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")
|
|
||||||
} else {
|
|
||||||
home := os.Getenv("HOME")
|
home := os.Getenv("HOME")
|
||||||
if home == "" {
|
if home == "" {
|
||||||
return opts, fmt.Errorf("HOME not specified")
|
return opts, fmt.Errorf("neither XDG_DATA_HOME nor HOME was set non-empty")
|
||||||
}
|
}
|
||||||
opts.GraphRoot = filepath.Join(home, ".containers", "storage")
|
dataDir = filepath.Join(home, ".local", "share")
|
||||||
}
|
}
|
||||||
|
opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")
|
||||||
opts.GraphDriverName = "vfs"
|
opts.GraphDriverName = "vfs"
|
||||||
return opts, nil
|
return opts, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user