diff --git a/pkg/action/install.go b/pkg/action/install.go index b3cab7160..b00ec6d88 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -332,9 +332,22 @@ func (i *Install) RunWithContext(ctx context.Context, ch ci.Charter, vals map[st // not mutate the shared *Configuration passed to NewInstall. // Callers that reuse the same cfg for a later real install must // still observe the original client and storage. See #11463. + // + // Copy fields explicitly: Configuration embeds sync.Mutex and + // logging.LogHolder (atomic.Pointer), which must not be copied + // by value (govet copylocks). origCfg := i.cfg - cfgCopy := *i.cfg - i.cfg = &cfgCopy + cfgCopy := &Configuration{ + RESTClientGetter: origCfg.RESTClientGetter, + Releases: origCfg.Releases, + KubeClient: origCfg.KubeClient, + RegistryClient: origCfg.RegistryClient, + Capabilities: origCfg.Capabilities, + CustomTemplateFuncs: origCfg.CustomTemplateFuncs, + HookOutputFunc: origCfg.HookOutputFunc, + } + cfgCopy.SetLogger(origCfg.Logger().Handler()) + i.cfg = cfgCopy defer func() { i.cfg = origCfg }() // Add mock objects in here so it doesn't use Kube API server