diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-01-07 14:27:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-07 14:27:19 -0800 |
commit | faa24627bb19d67b0e7a681673deb58922a634c1 (patch) | |
tree | c83c01e8c30592ca95e786baaa96f8ba65fe2199 /pkg | |
parent | 628b14ada7e892391fe92e88ea1e471eb6767acb (diff) | |
parent | b367855d5f87bffc980cbce28b35363a4e21ba7c (diff) | |
download | podman-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.go | 10 |
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 +} |