From 32cb151419d6d2745b5738b8a55f236a5d95f470 Mon Sep 17 00:00:00 2001 From: justinsb Date: Tue, 22 Nov 2022 08:12:00 -0500 Subject: [PATCH] Apply: Migration from CSA to SSA: set the operation to Apply If we don't, the (kops,Update) managed blocks are treated as different from the (kops,Apply) block. This causes conflicts when the two blocks specific incompatible values. Issue #14520 (I believe it is the fix!) --- pkg/applylib/applyset/applyset.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/applylib/applyset/applyset.go b/pkg/applylib/applyset/applyset.go index 3fc261a8a4..86560ea172 100644 --- a/pkg/applylib/applyset/applyset.go +++ b/pkg/applylib/applyset/applyset.go @@ -191,6 +191,11 @@ func createManagedFieldPatch(currentObject *unstructured.Unstructured) ([]byte, fixedManagedField := managedField.DeepCopy() if managedField.Manager == "kubectl-edit" || managedField.Manager == "kubectl-client-side-apply" { fixedManagedField.Manager = "kops" + fixedManagedField.Operation = "Apply" + } + // In case we have a kops & Update manager + if fixedManagedField.Manager == "kops" && fixedManagedField.Operation == "Update" { + fixedManagedField.Operation = "Apply" } fixedManagedFields = append(fixedManagedFields, *fixedManagedField) }