mirror of
https://github.com/containers/podman.git
synced 2025-06-28 14:29:04 +08:00
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>
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user