diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-02-26 15:32:53 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-02-26 15:32:53 -0500 |
commit | b8e6ef618bd9233796ef6dbff187052a499ea022 (patch) | |
tree | d748de619f0cfeb0f59bef4e299ab776c34e611f /libpod | |
parent | ee667dcf97df4ed38b2046b33911dad882829bf8 (diff) | |
download | podman-b8e6ef618bd9233796ef6dbff187052a499ea022.tar.gz podman-b8e6ef618bd9233796ef6dbff187052a499ea022.tar.bz2 podman-b8e6ef618bd9233796ef6dbff187052a499ea022.zip |
Move all storage configuration defaults into libpod
Instead of passing in defaults via WithStorageConfig after
computing them in cmd/podman/libpodruntime, do all defaults in
libpod itself.
This can alleviate ordering issues which caused settings in the
libpod config (most notably, volume path) to be ignored.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 827c22f5b..635783790 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -331,16 +331,13 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) { deepcopier.Copy(defaultRuntimeConfig).To(runtime.config) runtime.config.TmpDir = tmpDir - if rootless.IsRootless() { - // If we're rootless, override the default storage config - storageConf, volumePath, err := util.GetDefaultStoreOptions() - if err != nil { - return nil, errors.Wrapf(err, "error retrieving rootless storage config") - } - runtime.config.StorageConfig = storageConf - runtime.config.StaticDir = filepath.Join(storageConf.GraphRoot, "libpod") - runtime.config.VolumePath = volumePath + storageConf, volumePath, err := util.GetDefaultStoreOptions() + if err != nil { + return nil, errors.Wrapf(err, "error retrieving rootless storage config") } + runtime.config.StorageConfig = storageConf + runtime.config.StaticDir = filepath.Join(storageConf.GraphRoot, "libpod") + runtime.config.VolumePath = volumePath configPath := ConfigPath foundConfig := true |