mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
options: append CLI graph driver options
if --storage-opt are specified on the CLI append them after what is specified in the configuration files instead of overriding it. Closes: https://github.com/containers/podman/issues/9657 [NO TESTS NEEDED] Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user