From b8e6ef618bd9233796ef6dbff187052a499ea022 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 26 Feb 2019 15:32:53 -0500 Subject: 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 --- libpod/runtime.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'libpod') 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 -- cgit v1.2.3-54-g00ecf