Skip to content

Commit

Permalink
add filtering for only controlplane nodes to trigger reconciliation
Browse files Browse the repository at this point in the history
  • Loading branch information
amold1 committed Aug 16, 2024
1 parent cc0d43b commit bb66598
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion controller/linodecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / go-build-test

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / go-build-test

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / go-build-test

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / go-build-test

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / go-build-test

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / e2e-test (quick) / quick-e2e-tests

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / e2e-test (quick) / quick-e2e-tests

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / e2e-test (quick) / quick-e2e-tests

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / e2e-test (quick) / quick-e2e-tests

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / e2e-test (quick) / quick-e2e-tests

missing ',' before newline in composite literal

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / go-analyze

syntax error: unexpected newline in composite literal; possibly missing comma or }) (typecheck)

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / go-analyze

syntax error: unexpected newline in composite literal; possibly missing comma or } (typecheck)

Check failure on line 143 in controller/linodecluster_controller.go

View workflow job for this annotation

GitHub Actions / go-analyze

missing ',' before newline in composite literal (typecheck)
}
if err := r.TracedClient().List(ctx, &clusterScope.LinodeMachines, client.InNamespace(clusterScope.LinodeCluster.Namespace), client.MatchingLabels(labels)); err != nil {
return res, err
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit bb66598

Please sign in to comment.