diff --git a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go index f333db2cfd7..15248ab37c7 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go +++ b/control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go @@ -2342,6 +2342,12 @@ func (r *HostedControlPlaneReconciler) cleanupClusterNetworkOperatorResources(ct 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 diff --git a/control-plane-operator/controllers/hostedcontrolplane/manifests/cno.go b/control-plane-operator/controllers/hostedcontrolplane/manifests/cno.go index ce5383e07b2..b27d1911df3 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/manifests/cno.go +++ b/control-plane-operator/controllers/hostedcontrolplane/manifests/cno.go @@ -12,6 +12,7 @@ import ( const clusterNetworkOperator = "cluster-network-operator" const multusAdmissionController = "multus-admission-controller" const networkNodeIdentity = "network-node-identity" +const ovnKubeControlPlane = "ovnkube-control-plane" func ClusterNetworkOperatorDeployment(ns string) *appsv1.Deployment { return &appsv1.Deployment{ @@ -67,6 +68,15 @@ func NetworkNodeIdentityDeployment(namespace string) *appsv1.Deployment { } } +func OVNKubeControlPlaneDeployment(namespace string) *appsv1.Deployment { + return &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: namespace, + Name: ovnKubeControlPlane, + }, + } +} + func OVNKubeSBDBRoute(namespace string) *routev1.Route { return &routev1.Route{ ObjectMeta: metav1.ObjectMeta{