summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-07 14:27:19 -0800
committerGitHub <noreply@github.com>2019-01-07 14:27:19 -0800
commitfaa24627bb19d67b0e7a681673deb58922a634c1 (patch)
treec83c01e8c30592ca95e786baaa96f8ba65fe2199 /pkg
parent628b14ada7e892391fe92e88ea1e471eb6767acb (diff)
parentb367855d5f87bffc980cbce28b35363a4e21ba7c (diff)
downloadpodman-faa24627bb19d67b0e7a681673deb58922a634c1.tar.gz
podman-faa24627bb19d67b0e7a681673deb58922a634c1.tar.bz2
podman-faa24627bb19d67b0e7a681673deb58922a634c1.zip
Merge pull request #2078 from rhatdan/config.file
Add the configuration file used to setup storage to podman info
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
+}