Skip to content

Commit c35aa0e

Browse files
Stop cluster/topology reconciliation on Status changes
Signed-off-by: killianmuldoon <[email protected]>
1 parent f072182 commit c35aa0e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/controllers/topology/cluster/cluster_controller.go

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"sigs.k8s.io/controller-runtime/pkg/client"
3131
"sigs.k8s.io/controller-runtime/pkg/controller"
3232
"sigs.k8s.io/controller-runtime/pkg/handler"
33+
ctrlpredicates "sigs.k8s.io/controller-runtime/pkg/predicate"
3334
"sigs.k8s.io/controller-runtime/pkg/source"
3435

3536
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -77,6 +78,8 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
7778
For(&clusterv1.Cluster{}, builder.WithPredicates(
7879
// Only reconcile Cluster with topology.
7980
predicates.ClusterHasTopology(ctrl.LoggerFrom(ctx)),
81+
// Only reconcile on Cluster Generation change to avoid reconciling on Status updates.
82+
ctrlpredicates.GenerationChangedPredicate{},
8083
)).
8184
Named("topology/cluster").
8285
Watches(

0 commit comments

Comments
 (0)