From 69ace205356171835d920438fe411839c543f073 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 31 Mar 2021 16:45:35 -0400 Subject: Allow users to override default storage opts with --storage-opt We define in the man page that this overrides the default storage options, but the code was appending to the existing options. This PR also makes a change to allow users to specify --storage-opt="". This will turn off all storage options. https://github.com/containers/podman/issues/9852 Signed-off-by: Daniel J Walsh --- pkg/domain/infra/runtime_libpod.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/domain/infra') diff --git a/pkg/domain/infra/runtime_libpod.go b/pkg/domain/infra/runtime_libpod.go index b0d9dc797..a98c9168a 100644 --- a/pkg/domain/infra/runtime_libpod.go +++ b/pkg/domain/infra/runtime_libpod.go @@ -146,7 +146,11 @@ func getRuntime(ctx context.Context, fs *flag.FlagSet, opts *engineOpts) (*libpo // This should always be checked after storage-driver is checked if len(cfg.StorageOpts) > 0 { storageSet = true - storageOpts.GraphDriverOptions = cfg.StorageOpts + if len(cfg.StorageOpts) == 1 && cfg.StorageOpts[0] == "" { + storageOpts.GraphDriverOptions = []string{} + } else { + storageOpts.GraphDriverOptions = cfg.StorageOpts + } } if opts.migrate { options = append(options, libpod.WithMigrate()) -- cgit v1.2.3-54-g00ecf