summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-10 10:30:49 +0100
committerGitHub <noreply@github.com>2021-03-10 10:30:49 +0100
commit1ac2fb78170595ddb9227de17ab35fd118ed93f0 (patch)
treeb7280dfd9cb74e92c02b54afc2ef0acc0198167a /libpod
parent4d9227d22ce3df326f8c93c1e3619981ad9f5955 (diff)
parent6d4899745c43bb43c03dcb1114513f370996d757 (diff)
downloadpodman-1ac2fb78170595ddb9227de17ab35fd118ed93f0.tar.gz
podman-1ac2fb78170595ddb9227de17ab35fd118ed93f0.tar.bz2
podman-1ac2fb78170595ddb9227de17ab35fd118ed93f0.zip
Merge pull request #9676 from giuseppe/cli-overrides-conf
options: append CLI graph driver options
Diffstat (limited to 'libpod')
-rw-r--r--libpod/options.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 6344e1acc..48888a2f2 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -64,15 +64,22 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
setField = true
}
+ graphDriverChanged := false
if config.GraphDriverName != "" {
rt.storageConfig.GraphDriverName = config.GraphDriverName
rt.storageSet.GraphDriverNameSet = true
setField = true
+ graphDriverChanged = true
}
if config.GraphDriverOptions != nil {
- rt.storageConfig.GraphDriverOptions = make([]string, len(config.GraphDriverOptions))
- copy(rt.storageConfig.GraphDriverOptions, config.GraphDriverOptions)
+ if graphDriverChanged {
+ rt.storageConfig.GraphDriverOptions = make([]string, len(config.GraphDriverOptions))
+ copy(rt.storageConfig.GraphDriverOptions, config.GraphDriverOptions)
+ } else {
+ // append new options after what is specified in the config files
+ rt.storageConfig.GraphDriverOptions = append(rt.storageConfig.GraphDriverOptions, config.GraphDriverOptions...)
+ }
setField = true
}