diff --git a/api/internal/plugins/loader/loader.go b/api/internal/plugins/loader/loader.go index 07c18ecfa47..70af4af1f6f 100644 --- a/api/internal/plugins/loader/loader.go +++ b/api/internal/plugins/loader/loader.go @@ -47,16 +47,14 @@ func (l *Loader) Config() *types.PluginConfig { return l.pc } -// Copy the actual values of loader instead using the pointer values. -func (l Loader) DeepCopy(ldr ifc.Loader) Loader { +// Copy the actual values of pc instead using the pointer values. +func (l *Loader) SetConfig() { l.pc = &types.PluginConfig{ - PluginRestrictions: l.pc.PluginRestrictions, - BpLoadingOptions: l.pc.BpLoadingOptions, - FnpLoadingOptions: l.pc.FnpLoadingOptions, - HelmConfig: l.pc.HelmConfig, + l.pc.PluginRestrictions, + l.pc.BpLoadingOptions, + l.pc.FnpLoadingOptions, + l.pc.HelmConfig, } - l.SetWorkDir(ldr.Root()) - return l } // SetWorkDir sets the working directory for this loader's plugins diff --git a/api/internal/target/kusttarget.go b/api/internal/target/kusttarget.go index 176e155e42a..79fb917e783 100644 --- a/api/internal/target/kusttarget.go +++ b/api/internal/target/kusttarget.go @@ -44,7 +44,9 @@ func NewKustTarget( validator ifc.Validator, rFactory *resmap.Factory, pLdr *loader.Loader) *KustTarget { - pLdrCopy := pLdr.DeepCopy(ldr) + pLdrCopy := *pLdr + pLdrCopy.SetConfig() + pLdrCopy.SetWorkDir(ldr.Root()) return &KustTarget{ ldr: ldr, validator: validator,