summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-12-02 15:21:35 -0500
committerMatthew Heon <mheon@redhat.com>2018-12-02 15:21:35 -0500
commit562fa57dc9f497db772baa03bfa052082db68646 (patch)
tree47016e6dd700b37a896732ac83b6a6b9ad849b2d /libpod/runtime.go
parent92ff83f5b9dd00ff91dc8c3d6b48f1e0b5c5f3e2 (diff)
downloadpodman-562fa57dc9f497db772baa03bfa052082db68646.tar.gz
podman-562fa57dc9f497db772baa03bfa052082db68646.tar.bz2
podman-562fa57dc9f497db772baa03bfa052082db68646.zip
Move rootless storage config into libpod
Previous commits ensured that we would use database-configured paths if not explicitly overridden. However, our runtime generation did unconditionally override storage config, which made this useless. Move rootless storage configuration setup to libpod, and change storage setup so we only override if a setting is explicitly set, so we can still override what we want. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index e01fa781b..6a5d2ad39 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -278,6 +278,15 @@ 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, err := util.GetDefaultRootlessStoreOptions()
+ if err != nil {
+ return nil, errors.Wrapf(err, "error retrieving rootless storage config")
+ }
+ runtime.config.StorageConfig = storageConf
+ }
+
configPath := ConfigPath
foundConfig := true
rootlessConfigPath := ""