From e9fe245626e793ed24cd3baa39d6f237991a135c Mon Sep 17 00:00:00 2001 From: Joe Doss Date: Mon, 30 Mar 2026 00:51:38 -0500 Subject: [PATCH] Fix shell driver DriverOpts cross-contamination in secret creation When creating a secret with driver=shell via the API, the file driver's default DriverOpts (including path) were applied because DriverOpts was empty. The shell driver rejects path as an unknown option, making it impossible to create shell-driver secrets via the REST API or podman-remote. Only apply default DriverOpts from config when the requested driver matches the configured default driver. Signed-off-by: Joe Doss (cherry picked from commit 667f55c2ce37fa9ff39cf3da961b80733bfeec1e) Signed-off-by: Paul Holzinger --- pkg/domain/infra/abi/secrets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/domain/infra/abi/secrets.go b/pkg/domain/infra/abi/secrets.go index 2bb2ae2b9c..37bcdf8c28 100644 --- a/pkg/domain/infra/abi/secrets.go +++ b/pkg/domain/infra/abi/secrets.go @@ -33,7 +33,7 @@ func (ic *ContainerEngine) SecretCreate(_ context.Context, name string, reader i if options.Driver == "" { options.Driver = cfg.Secrets.Driver } - if len(options.DriverOpts) == 0 { + if len(options.DriverOpts) == 0 && options.Driver == cfg.Secrets.Driver { options.DriverOpts = cfg.Secrets.Opts } if options.DriverOpts == nil {