Skip to content

Commit

Permalink
Reset defaultConfigFile if defaultOverrideConfigFile exits.
Browse files Browse the repository at this point in the history
Currently DefaultConfigFile does not report back the storage.conf file
that is actually used if /etc/containers/storage.conf exists it should
be reported back to the user. This issue was seen with Podman.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Nov 30, 2021
1 parent f84b05e commit 0baf764
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func init() {
defaultStoreOptions.GraphDriverName = ""

if _, err := os.Stat(defaultOverrideConfigFile); err == nil {
// The DefaultConfigFile(rootless) function returns the path
// of the used storage.conf file, by returning defaultConfigFile
// If override exists containers/storage uses it by default.
defaultConfigFile = defaultOverrideConfigFile
ReloadConfigurationFileIfNeeded(defaultOverrideConfigFile, &defaultStoreOptions)
} else {
if !os.IsNotExist(err) {
Expand Down

0 comments on commit 0baf764

Please sign in to comment.