add edit-fix for patchesStrategicMerge to patches

This commit is contained in:
yugo kobayashi
2022-07-29 17:34:38 +00:00
parent 1b0fe2a078
commit 64f42ea45f
3 changed files with 110 additions and 0 deletions

View File

@@ -222,6 +222,13 @@ func (k *Kustomization) FixKustomizationPreMarshalling() error {
k.Patches = append(k.Patches, k.PatchesJson6902...)
k.PatchesJson6902 = nil
if k.PatchesStrategicMerge != nil {
for _, patchStrategicMerge := range k.PatchesStrategicMerge {
k.Patches = append(k.Patches, Patch{Patch: string(patchStrategicMerge)})
}
k.PatchesStrategicMerge = nil
}
// this fix is not in FixKustomizationPostUnmarshalling because
// it will break some commands like `create` and `add`. those
// commands depend on 'commonLabels' field