diff --git a/pkg/machinery/config/configloader/internal/decoder/selector.go b/pkg/machinery/config/configloader/internal/decoder/selector.go index 752521740a..502bc35c28 100644 --- a/pkg/machinery/config/configloader/internal/decoder/selector.go +++ b/pkg/machinery/config/configloader/internal/decoder/selector.go @@ -187,7 +187,7 @@ func deleteForPath(val reflect.Value, path []string, key, value string) error { if idx := val.MapIndex(searchForVal); idx.IsValid() { if len(path) == 0 { - val.SetMapIndex(searchForVal, reflect.Zero(valType.Elem())) + val.SetMapIndex(searchForVal, reflect.Value{}) return nil } diff --git a/pkg/machinery/config/configpatcher/testdata/patchdelete/controlplane_expected.yaml b/pkg/machinery/config/configpatcher/testdata/patchdelete/controlplane_expected.yaml index 87d6722672..86d4c306b4 100644 --- a/pkg/machinery/config/configpatcher/testdata/patchdelete/controlplane_expected.yaml +++ b/pkg/machinery/config/configpatcher/testdata/patchdelete/controlplane_expected.yaml @@ -26,8 +26,6 @@ machine: hostDNS: enabled: true forwardKubeDNSToHost: true - nodeLabels: - node.kubernetes.io/exclude-from-external-load-balancers: "" cluster: id: 0raF93qnkMvF-FZNuvyGozXNdLiT2FOWSlyBaW4PR-w= secret: pofHbABZq7VXuObsdLdy/bHmz6hlMHZ3p8+6WKrv1ic= diff --git a/pkg/machinery/config/configpatcher/testdata/patchdelete/strategic2.yaml b/pkg/machinery/config/configpatcher/testdata/patchdelete/strategic2.yaml index b1db44b65e..496c6994b1 100644 --- a/pkg/machinery/config/configpatcher/testdata/patchdelete/strategic2.yaml +++ b/pkg/machinery/config/configpatcher/testdata/patchdelete/strategic2.yaml @@ -4,3 +4,7 @@ cluster: admissionControl: - name: PodSecurity $patch: delete +machine: + nodeLabels: + node.kubernetes.io/exclude-from-external-load-balancers: + $patch: delete