@ -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.
// not mutate the shared *Configuration passed to NewInstall.
// Callers that reuse the same cfg for a later real install must
// Callers that reuse the same cfg for a later real install must
// still observe the original client and storage. See #11463.
// 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
origCfg := i . cfg
cfgCopy := * i . cfg
cfgCopy := & Configuration {
i . cfg = & cfgCopy
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 } ( )
defer func ( ) { i . cfg = origCfg } ( )
// Add mock objects in here so it doesn't use Kube API server
// Add mock objects in here so it doesn't use Kube API server