store: prefer /etc/containers/storage.conf

when running in rootful mode, if it is present, prefer the override path
/etc/containers/storage.conf instead of using the default storage.conf
provided by the package under the /usr/share/containers/ directory.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit f64e1bd14a)
This commit is contained in:
Giuseppe Scrivano 2023-01-16 19:28:38 +01:00
parent 038679c6bf
commit 13a86a4f8d
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772
1 changed files with 3 additions and 0 deletions

View File

@ -173,6 +173,9 @@ func DefaultConfigFile(rootless bool) (string, error) {
return path, nil
}
if !rootless {
if _, err := os.Stat(defaultOverrideConfigFile); err == nil {
return defaultOverrideConfigFile, nil
}
return defaultConfigFile, nil
}