mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 09:51:23 +00:00
allow general name and kind changes via an options field in patches
This commit is contained in:
@@ -22,6 +22,7 @@ type plugin struct {
|
||||
Path string `json:"path,omitempty" yaml:"path,omitempty"`
|
||||
Patch string `json:"patch,omitempty" yaml:"patch,omitempty"`
|
||||
Target *types.Selector `json:"target,omitempty" yaml:"target,omitempty"`
|
||||
Options map[string]bool `json:"options,omitempty" yaml:"options,omitempty"`
|
||||
}
|
||||
|
||||
//noinspection GoUnusedGlobalVariable
|
||||
@@ -64,6 +65,12 @@ func (p *plugin) Config(
|
||||
}
|
||||
if errSM == nil {
|
||||
p.loadedPatch = patchSM
|
||||
if p.Options["allowNameChange"] {
|
||||
p.loadedPatch.SetAllowNameChange("true")
|
||||
}
|
||||
if p.Options["allowKindChange"] {
|
||||
p.loadedPatch.SetAllowKindChange("true")
|
||||
}
|
||||
} else {
|
||||
p.decodedPatch = patchJson
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user