From 5682e1f0156858d0709710623a1ce868d08b95ab Mon Sep 17 00:00:00 2001 From: Bryan Cox Date: Wed, 17 Jun 2026 06:11:14 -0400 Subject: [PATCH] fix(OCPBUGS-88531): Remove CPO-side restart logic for CNO operands CNO now handles restart-date annotation propagation to all its operands (multus-admission-controller, network-node-identity, ovnkube-control-plane, cloud-network-config-controller) directly via the fix in CNO PR #3030. The CPO-side restart logic for these deployments is now redundant and can be removed. Co-Authored-By: Claude Opus 4.6 --- .../hostedcontrolplane_controller.go | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go index 5861a1fda10d..586a188dce97 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go @@ -2021,30 +2021,6 @@ func (r *HostedControlPlaneReconciler) reconcileValidIDPConfigurationCondition(c } func (r *HostedControlPlaneReconciler) cleanupClusterNetworkOperatorResources(ctx context.Context, hcp *hyperv1.HostedControlPlane, hasRouteCap bool) error { - if restartAnnotation, ok := hcp.Annotations[hyperv1.RestartDateAnnotation]; ok { - // CNO manages overall multus-admission-controller deployment. CPO manages restarts. - // TODO: why is this not done in CNO? - // Only restart multus deployment if Multus is not disabled - if !netutil.IsDisableMultiNetwork(hcp) { - multusDeployment := manifests.MultusAdmissionControllerDeployment(hcp.Namespace) - if err := cnov2.SetRestartAnnotationAndPatch(ctx, r.Client, multusDeployment, restartAnnotation); err != nil { - return fmt.Errorf("failed to restart multus admission controller: %w", err) - } - } - - // CNO manages overall network-node-identity deployment. CPO manages restarts. - networkNodeIdentityDeployment := manifests.NetworkNodeIdentityDeployment(hcp.Namespace) - if err := cnov2.SetRestartAnnotationAndPatch(ctx, r.Client, networkNodeIdentityDeployment, restartAnnotation); err != nil { - return fmt.Errorf("failed to restart network node identity: %w", err) - } - - // CNO manages overall ovnkube-control-plane deployment. CPO manages restarts. Note that cnov2.SetRestartAnnotationAndPatch just returns err == nil if the deployment isn't found (so if OVN isn't being used) - ovnKubeControlPlaneDeployment := manifests.OVNKubeControlPlaneDeployment(hcp.Namespace) - if err := cnov2.SetRestartAnnotationAndPatch(ctx, r.Client, ovnKubeControlPlaneDeployment, restartAnnotation); err != nil { - return fmt.Errorf("failed to restart ovnkube-control-plane: %w", err) - } - } - // Clean up ovnkube-sbdb Route if exists if hasRouteCap { if _, err := k8sutil.DeleteIfNeeded(ctx, r.Client, manifests.OVNKubeSBDBRoute(hcp.Namespace)); err != nil {