kubevirt / cluster-network-addons-operator

Deploy additional networking components on top of your Kubernetes cluster
Apache License 2.0
68 stars 48 forks source link

Improve CNAO/KMP CONTROL_PLANE_KEY flow #1567

Open oshoval opened 1 year ago

oshoval commented 1 year ago

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. EDIT - oldest version at was created after 1145 so we can handle this bullet https://github.com/kubevirt/cluster-network-addons-operator/releases/tag/v0.76.0

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:

kubevirt-bot commented 8 months ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

oshoval commented 8 months ago

/remove-lifecycle stale

kubevirt-bot commented 5 months ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

oshoval commented 5 months ago

/remove-lifecycle stale

kubevirt-bot commented 2 months ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kubevirt-bot commented 1 month ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten