Skip to content

Commit

Permalink
numaresources:controller: do not watch mcp
Browse files Browse the repository at this point in the history
On HyperShift platform the MCP crds are not exist.
Hence, we should setup a watches for them only when running
on OCP platform.

Signed-off-by: Talor Itzhak <[email protected]>
  • Loading branch information
Tal-or committed Nov 18, 2024
1 parent 69bca7b commit 719c5d5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controllers/numaresourcesoperator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,18 @@ func (r *NUMAResourcesOperatorReconciler) SetupWithManager(mgr ctrl.Manager) err

b := ctrl.NewControllerManagedBy(mgr).For(&nropv1.NUMAResourcesOperator{})
if r.Platform == platform.OpenShift {
b = b.Owns(&securityv1.SecurityContextConstraints{}).
b.Watches(
&machineconfigv1.MachineConfigPool{},
handler.EnqueueRequestsFromMapFunc(r.mcpToNUMAResourceOperator),
builder.WithPredicates(mcpPredicates)).
Owns(&securityv1.SecurityContextConstraints{}).
Owns(&machineconfigv1.MachineConfig{}, builder.WithPredicates(p))
}
return b.Owns(&apiextensionv1.CustomResourceDefinition{}).
Owns(&corev1.ServiceAccount{}, builder.WithPredicates(p)).
Owns(&rbacv1.RoleBinding{}, builder.WithPredicates(p)).
Owns(&rbacv1.Role{}, builder.WithPredicates(p)).
Owns(&appsv1.DaemonSet{}, builder.WithPredicates(p)).
Watches(
&machineconfigv1.MachineConfigPool{},
handler.EnqueueRequestsFromMapFunc(r.mcpToNUMAResourceOperator),
builder.WithPredicates(mcpPredicates)).
Complete(r)
}

Expand Down

0 comments on commit 719c5d5

Please sign in to comment.