Simplify kind and name change code.

This commit is contained in:
monopole
2021-05-09 16:18:34 -07:00
parent fcfdf6be51
commit 82abd7e9ea
6 changed files with 27 additions and 30 deletions

View File

@@ -62,10 +62,10 @@ func (p *PatchTransformerPlugin) Config(
if errSM == nil {
p.loadedPatch = patchSM
if p.Options["allowNameChange"] {
p.loadedPatch.SetAllowNameChange("true")
p.loadedPatch.AllowNameChange()
}
if p.Options["allowKindChange"] {
p.loadedPatch.SetAllowKindChange("true")
p.loadedPatch.AllowKindChange()
}
} else {
p.decodedPatch = patchJson