Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default location for storage.conf to... #1221

Merged
merged 2 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions storage.conf-freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# files.
#
# Note: The storage.conf file overrides other storage.conf files based on this precedence:
# /usr/containers/storage.conf
# /etc/containers/storage.conf
# /usr/local/share/containers/storage.conf
# /usr/local/etc/containers/storage.conf
# $HOME/.config/containers/storage.conf
# $XDG_CONFIG_HOME/containers/storage.conf (If XDG_CONFIG_HOME is set)
# See man 5 containers-storage.conf for more information
Expand Down
16 changes: 0 additions & 16 deletions types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,6 @@ type TomlConfig struct {
} `toml:"storage"`
}

const (
// these are default path for run and graph root for rootful users
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/run/containers/storage"
defaultGraphRoot string = "/var/lib/containers/storage"
)

// 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
)

const (
overlayDriver = "overlay"
overlay2 = "overlay2"
Expand Down
17 changes: 17 additions & 0 deletions types/options_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package types

const (
// these are default path for run and graph root for rootful users
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/run/containers/storage"
defaultGraphRoot string = "/var/lib/containers/storage"
)

// 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
)
17 changes: 17 additions & 0 deletions types/options_freebsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package types

const (
// these are default path for run and graph root for rootful users
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/var/run/containers/storage"
defaultGraphRoot string = "/var/db/containers/storage"
)

// defaultConfigFile path to the system wide storage.conf file
var (
defaultConfigFile = "/usr/local/share/containers/storage.conf"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the example conf file should change instead. Generally, this kind of thing tends to live either in /usr/local/share or /usr/local/etc with any file likely to be changed locally strongly preferred to be in /usr/local/etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed storage.conf-freebsd to match the compiled in default

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THat works for me, I was mostly concerned about the difference between the two. Thanks @dfr

defaultOverrideConfigFile = "/usr/local/etc/containers/storage.conf"
defaultConfigFileSet = false
// DefaultStoreOptions is a reasonable default set of options.
defaultStoreOptions StoreOptions
)
17 changes: 17 additions & 0 deletions types/options_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package types

const (
// these are default path for run and graph root for rootful users
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/run/containers/storage"
defaultGraphRoot string = "/var/lib/containers/storage"
)

// 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
)
17 changes: 17 additions & 0 deletions types/options_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package types

const (
// these are default path for run and graph root for rootful users
// for rootless path is constructed via getRootlessStorageOpts
defaultRunRoot string = "/run/containers/storage"
defaultGraphRoot string = "/var/lib/containers/storage"
)

// 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
)