Skip to content

Commit

Permalink
fix: krm exec function working dir
Browse files Browse the repository at this point in the history
  • Loading branch information
aabouzaid committed Oct 9, 2022
1 parent 5885360 commit 8566b9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 6 additions & 8 deletions api/internal/plugins/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion api/internal/target/kusttarget.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8566b9b

Please sign in to comment.