Skip to content

Commit 7d9965b

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

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/controllers/topology/cluster/cluster_controller.go

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import (
3232
"sigs.k8s.io/controller-runtime/pkg/handler"
3333
"sigs.k8s.io/controller-runtime/pkg/source"
3434

35+
ctrlpredicates "sigs.k8s.io/controller-runtime/pkg/predicate"
36+
3537
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3638
"sigs.k8s.io/cluster-api/api/v1beta1/index"
3739
"sigs.k8s.io/cluster-api/controllers/external"
@@ -77,6 +79,8 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
7779
For(&clusterv1.Cluster{}, builder.WithPredicates(
7880
// Only reconcile Cluster with topology.
7981
predicates.ClusterHasTopology(ctrl.LoggerFrom(ctx)),
82+
// Only reconcile on Cluster Generation change to avoid reconciling on Status updates.
83+
ctrlpredicates.GenerationChangedPredicate{},
8084
)).
8185
Named("topology/cluster").
8286
Watches(

0 commit comments

Comments
 (0)