summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-01-07 10:01:44 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2019-01-07 10:02:26 -0500
commitb367855d5f87bffc980cbce28b35363a4e21ba7c (patch)
tree3d0c1427903b2b4f2a3afa1fcb418b03d749cc48 /pkg
parenta219431a317a2b6d9647ce81b7c845345e51b7da (diff)
downloadpodman-b367855d5f87bffc980cbce28b35363a4e21ba7c.tar.gz
podman-b367855d5f87bffc980cbce28b35363a4e21ba7c.tar.bz2
podman-b367855d5f87bffc980cbce28b35363a4e21ba7c.zip
Add the configuration file used to setup storage to podman info
Users have no idea what storage configuration file is used to setup storage, so adding this to podman info, should make it easier to discover. This requires a revendor of containers/storage Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/util/utils.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index a6f52cb3e..20ba20a52 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -314,7 +314,7 @@ func GetDefaultStoreOptions() (storage.StoreOptions, string, error) {
return storageOpts, volumePath, err
}
- storageConf := filepath.Join(os.Getenv("HOME"), ".config/containers/storage.conf")
+ storageConf := StorageConfigFile()
if _, err := os.Stat(storageConf); err == nil {
storage.ReloadConfigurationFile(storageConf, &storageOpts)
} else if os.IsNotExist(err) {
@@ -334,3 +334,11 @@ func GetDefaultStoreOptions() (storage.StoreOptions, string, error) {
}
return storageOpts, volumePath, nil
}
+
+// StorageConfigFile returns the path to the storage config file used
+func StorageConfigFile() string {
+ if rootless.IsRootless() {
+ return filepath.Join(os.Getenv("HOME"), ".config/containers/storage.conf")
+ }
+ return storage.DefaultConfigFile
+}