Skip to content

Commit

Permalink
Expose System wide config file
Browse files Browse the repository at this point in the history
Currently Podman warns when attempting to reset storage, if the
system wide storage.conf file
/usr/share/containers/storage.conf exists.

Since distros ship this, we need to allow Podman to check if the
default is the System default and therefore do not warn.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Oct 26, 2022
1 parent bfd0ff1 commit 68a0b36
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
5 changes: 5 additions & 0 deletions types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ var (
once sync.Once
storeOptions StoreOptions
storeError error
defaultConfigFileSet bool
// defaultConfigFile path to the system wide storage.conf file
defaultConfigFile = SystemConfigFile
// DefaultStoreOptions is a reasonable default set of options.
defaultStoreOptions StoreOptions
)

func loadDefaultStoreOptions() {
Expand Down
6 changes: 1 addition & 5 deletions types/options_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ const (
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/run/containers/storage"
defaultGraphRoot string = "/var/lib/containers/storage"
SystemConfigFile = "/usr/share/containers/storage.conf"
)

// defaultConfigFile path to the system wide storage.conf file
var (
defaultConfigFile = "/usr/share/containers/storage.conf"
defaultOverrideConfigFile = "/etc/containers/storage.conf"
defaultConfigFileSet = false
// DefaultStoreOptions is a reasonable default set of options.
defaultStoreOptions StoreOptions
)
5 changes: 1 addition & 4 deletions types/options_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ const (
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/var/run/containers/storage"
defaultGraphRoot string = "/var/db/containers/storage"
SystemConfigFile = "/usr/local/share/containers/storage.conf"
)

// defaultConfigFile path to the system wide storage.conf file
var (
defaultConfigFile = "/usr/local/share/containers/storage.conf"
defaultOverrideConfigFile = "/usr/local/etc/containers/storage.conf"
defaultConfigFileSet = false
// DefaultStoreOptions is a reasonable default set of options.
defaultStoreOptions StoreOptions
)
5 changes: 1 addition & 4 deletions types/options_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ const (
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/run/containers/storage"
defaultGraphRoot string = "/var/lib/containers/storage"
SystemConfigFile = "/usr/share/containers/storage.conf"
)

// defaultConfigFile path to the system wide storage.conf file
var (
defaultConfigFile = "/usr/share/containers/storage.conf"
defaultOverrideConfigFile = "/etc/containers/storage.conf"
defaultConfigFileSet = false
// DefaultStoreOptions is a reasonable default set of options.
defaultStoreOptions StoreOptions
)
5 changes: 1 addition & 4 deletions types/options_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ const (
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/run/containers/storage"
defaultGraphRoot string = "/var/lib/containers/storage"
SystemConfigFile = "/usr/share/containers/storage.conf"
)

// defaultConfigFile path to the system wide storage.conf file
var (
defaultConfigFile = "/usr/share/containers/storage.conf"
defaultOverrideConfigFile = "/etc/containers/storage.conf"
defaultConfigFileSet = false
// DefaultStoreOptions is a reasonable default set of options.
defaultStoreOptions StoreOptions
)

0 comments on commit 68a0b36

Please sign in to comment.