Skip to content

Commit 282bb59

Browse files
MarSikopenshift-cherrypick-robot
authored andcommitted
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.
1 parent 2ed182b commit 282bb59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/performanceprofile/controller/performanceprofile_controller.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ func (r *PerformanceProfileReconciler) SetupWithManager(mgr ctrl.Manager) error
113113
mcpOld := e.ObjectOld.(*mcov1.MachineConfigPool)
114114
mcpNew := e.ObjectNew.(*mcov1.MachineConfigPool)
115115

116-
return !reflect.DeepEqual(mcpOld.Status.Conditions, mcpNew.Status.Conditions)
116+
// We care about labels and the spec section, because those influence matching of Nodes and KubeletConfigs
117+
return !reflect.DeepEqual(mcpOld.Status.Conditions, mcpNew.Status.Conditions) || !reflect.DeepEqual(mcpOld.Labels, mcpNew.Labels) || !reflect.DeepEqual(mcpOld.Spec, mcpNew.Spec)
117118
},
118119
}
119120

@@ -312,7 +313,8 @@ func mcpToPerformanceProfileReconcileRequests(profiles *performancev2.Performanc
312313
mcpNodeSelector, err := metav1.LabelSelectorAsSelector(mcp.Spec.NodeSelector)
313314
if err != nil {
314315
klog.Errorf("failed to parse the selector %v: %v", mcp.Spec.NodeSelector, err)
315-
return nil
316+
// Skip the broken MCP, but process others
317+
continue
316318
}
317319

318320
if mcpNodeSelector.Matches(profileNodeSelector) {

0 commit comments

Comments
 (0)