From 282bb5998a8693d1c6ae66bfa6e7d667dbe91dbb Mon Sep 17 00:00:00 2001 From: Martin Sivak Date: Thu, 6 Nov 2025 13:22:40 +0100 Subject: [PATCH] OCPBUGS-63321: Watch MCP changes including spec and labels MCP edits are properly watched by the runtime, but the predicate only reacted to changes in the MCP.status section. This meant we missed label and selector changes and never reconciled when those were changed. --- .../controller/performanceprofile_controller.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/performanceprofile/controller/performanceprofile_controller.go b/pkg/performanceprofile/controller/performanceprofile_controller.go index cb1fc5c235..98150f63e5 100644 --- a/pkg/performanceprofile/controller/performanceprofile_controller.go +++ b/pkg/performanceprofile/controller/performanceprofile_controller.go @@ -113,7 +113,8 @@ func (r *PerformanceProfileReconciler) SetupWithManager(mgr ctrl.Manager) error mcpOld := e.ObjectOld.(*mcov1.MachineConfigPool) mcpNew := e.ObjectNew.(*mcov1.MachineConfigPool) - return !reflect.DeepEqual(mcpOld.Status.Conditions, mcpNew.Status.Conditions) + // We care about labels and the spec section, because those influence matching of Nodes and KubeletConfigs + return !reflect.DeepEqual(mcpOld.Status.Conditions, mcpNew.Status.Conditions) || !reflect.DeepEqual(mcpOld.Labels, mcpNew.Labels) || !reflect.DeepEqual(mcpOld.Spec, mcpNew.Spec) }, } @@ -312,7 +313,8 @@ func mcpToPerformanceProfileReconcileRequests(profiles *performancev2.Performanc mcpNodeSelector, err := metav1.LabelSelectorAsSelector(mcp.Spec.NodeSelector) if err != nil { klog.Errorf("failed to parse the selector %v: %v", mcp.Spec.NodeSelector, err) - return nil + // Skip the broken MCP, but process others + continue } if mcpNodeSelector.Matches(profileNodeSelector) {