cluster-network-addons-operator icon indicating copy to clipboard operation
cluster-network-addons-operator copied to clipboard

Improve CNAO/KMP CONTROL_PLANE_KEY flow

Open oshoval opened this issue 1 year ago • 4 comments

What happened: CNAO has to remove the KUBEMACPOOL_CONTROL_PLANE_KEY because of two cases:

  1. It is in KMP manifest under the NS, so before applying the NS it need to remove it. (even that it already exists, it will amend it IIRC), See https://github.com/kubevirt/cluster-network-addons-operator/pull/1145/files#r796372158 PR https://github.com/k8snetworkplumbingwg/kubemacpool/pull/389 removes it, once there will be a KMP release we can remove the deletion during reconcile.

  2. For backward compatibility, for versions that had this label before the fix presented by https://github.com/kubevirt/cluster-network-addons-operator/pull/1145 We remove the labels by cleanUpNamespaceLabels.

What you expected to happen: Code should be cleaner and easier, while maintaining the functionality.

About 1: We can remove it from KMP itself, and then we can remove the code mentioned on 1, see link above. Note that we might can already remove it now due to https://github.com/kubevirt/cluster-network-addons-operator/pull/1566 which removes it in the KMP bump.

About 2: Once we don't support anymore a version that had the bug pre 1145 we can remove this function.

How to reproduce it (as minimally and precisely as possible): See notes above.

Anything else we need to know?: Maybe we can even consider removing the NS resources in all CNAO component bump scripts. Can be done either in the component bump scripts or maybe the reconcile should just ignore it ?

I think once we fix it, it is better to remove this code as well https://github.com/kubevirt/cluster-network-addons-operator/pull/1566/files#diff-bec741ac25fac96fd708633e7c3fbd240ad554c225598843e75f2b0001cf2c50R131-R134 because removing all the labels instead just the offending ones, can cause problems in case in the future there will be labels we do want to keep.

Environment:

oshoval avatar Jun 15 '23 08:06 oshoval