From b367855d5f87bffc980cbce28b35363a4e21ba7c Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 7 Jan 2019 10:01:44 -0500 Subject: 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 --- pkg/util/utils.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'pkg/util/utils.go') 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 +} -- cgit v1.2.3-54-g00ecf