summaryrefslogtreecommitdiff
path: root/cmd/podman/libpodruntime/runtime.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-06-26 19:11:29 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-27 14:07:17 +0000
commit6f3208b5993f110aa86adb010b82e5d77ef8dfed (patch)
treea8460b0720c67e9a6b1deb8e1e3e5624294e5b3b /cmd/podman/libpodruntime/runtime.go
parent3306d3e120b126fd2238b870733d78dd93787e71 (diff)
downloadpodman-6f3208b5993f110aa86adb010b82e5d77ef8dfed.tar.gz
podman-6f3208b5993f110aa86adb010b82e5d77ef8dfed.tar.bz2
podman-6f3208b5993f110aa86adb010b82e5d77ef8dfed.zip
runtime: change rootless data storage default path
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #936 Approved by: rhatdan
Diffstat (limited to 'cmd/podman/libpodruntime/runtime.go')
-rw-r--r--cmd/podman/libpodruntime/runtime.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go
index abe0115e9..b48667653 100644
--- a/cmd/podman/libpodruntime/runtime.go
+++ b/cmd/podman/libpodruntime/runtime.go
@@ -25,16 +25,15 @@ func GetRootlessStorageOpts() (storage.StoreOptions, error) {
opts.RunRoot = filepath.Join(libpod.GetRootlessRuntimeDir(), "run")
- dataDir := os.Getenv("XDG_DATA_DIR")
- if dataDir != "" {
- opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")
- } else {
+ dataDir := os.Getenv("XDG_DATA_HOME")
+ if dataDir == "" {
home := os.Getenv("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"
return opts, nil
}