summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-12-03 15:13:07 -0500
committerMatthew Heon <mheon@redhat.com>2018-12-03 15:13:07 -0500
commit7c575bdce26b0cc5560bb5a8fe5ac680c2843903 (patch)
tree8e40517c70ed6df09bf3db9b43f6a30aa0b21fe3 /libpod
parent677c44446375680c5a69a9612f7df42b25de783f (diff)
downloadpodman-7c575bdce26b0cc5560bb5a8fe5ac680c2843903.tar.gz
podman-7c575bdce26b0cc5560bb5a8fe5ac680c2843903.tar.bz2
podman-7c575bdce26b0cc5560bb5a8fe5ac680c2843903.zip
Fix libpod static dir selection when graphroot changed
When graphroot is set by the user, we should set libpod's static directory to a subdirectory of that by default, to duplicate previous behavior. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/options.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 661bd8d91..4a3d30cfe 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -37,6 +37,11 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
if config.GraphRoot != "" {
rt.config.StorageConfig.GraphRoot = config.GraphRoot
rt.configuredFrom.storageGraphRootSet = true
+
+ // Also set libpod static dir, so we are a subdirectory
+ // of the c/storage store by default
+ rt.config.StaticDir = filepath.Join(config.GraphRoot, "libpod")
+ rt.configuredFrom.libpodStaticDirSet = true
}
if config.GraphDriverName != "" {
@@ -44,13 +49,6 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
rt.configuredFrom.storageGraphDriverSet = true
}
- // Only set our static dir if it was not already explicitly
- // overridden
- if config.GraphRoot != "" && !rt.configuredFrom.libpodStaticDirSet {
- rt.config.StaticDir = filepath.Join(config.GraphRoot, "libpod")
- rt.configuredFrom.libpodStaticDirSet = true
- }
-
if config.GraphDriverOptions != nil {
rt.config.StorageConfig.GraphDriverOptions = make([]string, len(config.GraphDriverOptions))
copy(rt.config.StorageConfig.GraphDriverOptions, config.GraphDriverOptions)