fix(kustomize): call json6902 only when needed

Call json6902 transformer only when there are patches to apply.

Addresses #5956
This commit is contained in:
Ramiro Algozino
2025-10-02 19:19:27 +02:00
parent 68fa5177e2
commit 24ea1b951a
2 changed files with 8 additions and 2 deletions

View File

@@ -89,7 +89,10 @@ func (p *PatchTransformerPlugin) Transform(m resmap.ResMap) error {
if p.smPatches != nil {
return p.transformStrategicMerge(m)
}
return p.transformJson6902(m)
if p.jsonPatches != nil {
return p.transformJson6902(m)
}
return nil
}
// transformStrategicMerge applies each loaded strategic merge patch

View File

@@ -94,7 +94,10 @@ func (p *plugin) Transform(m resmap.ResMap) error {
if p.smPatches != nil {
return p.transformStrategicMerge(m)
}
return p.transformJson6902(m)
if p.jsonPatches != nil {
return p.transformJson6902(m)
}
return nil
}
// transformStrategicMerge applies each loaded strategic merge patch