From bb665987c9299c2687059d2160fa9cf68708ab73 Mon Sep 17 00:00:00 2001 From: Amol Deodhar Date: Thu, 15 Aug 2024 21:26:21 -0400 Subject: [PATCH] add filtering for only controlplane nodes to trigger reconciliation --- controller/linodecluster_controller.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/controller/linodecluster_controller.go b/controller/linodecluster_controller.go index 7ea144b2..54dfcf8a 100644 --- a/controller/linodecluster_controller.go +++ b/controller/linodecluster_controller.go @@ -138,7 +138,10 @@ func (r *LinodeClusterReconciler) reconcile( } }() - labels := map[string]string{clusterv1.ClusterNameLabel: clusterScope.LinodeCluster.Name} + labels := map[string]string{ + clusterv1.ClusterNameLabel: clusterScope.LinodeCluster.Name, + clusterv1.MachineControlPlaneNameLabel: clusterScope.LinodeCluster.Name + "-control-plane" + } if err := r.TracedClient().List(ctx, &clusterScope.LinodeMachines, client.InNamespace(clusterScope.LinodeCluster.Namespace), client.MatchingLabels(labels)); err != nil { return res, err } @@ -434,6 +437,11 @@ func (r *LinodeClusterReconciler) linodeMachineToLinodeCluster(logger logr.Logge return nil } + // We only need control plane machines to trigger reconciliation + if !strings.Contains(linodeMachine.Name, "control-plane") { + return nil + } + linodeCluster := infrav1alpha2.LinodeCluster{} if err := r.TracedClient().Get( ctx,