Skip to content

Commit dcbe30d

Browse files
authored
Merge pull request #841 from ncdc/fix-cluster-paused-map
Fix issue with cluster paused map function
2 parents e732c32 + cca9e61 commit dcbe30d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

controllers/azurecluster_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ type AzureClusterReconciler struct {
5151
}
5252

5353
func (r *AzureClusterReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error {
54-
azCluster := &infrav1.AzureCluster{}
5554
c, err := ctrl.NewControllerManagedBy(mgr).
5655
WithOptions(options).
57-
For(azCluster).
56+
For(&infrav1.AzureCluster{}).
5857
WithEventFilter(predicates.ResourceNotPaused(r.Log)). // don't queue reconcile if resource is paused
5958
Build(r)
6059
if err != nil {
@@ -65,7 +64,7 @@ func (r *AzureClusterReconciler) SetupWithManager(mgr ctrl.Manager, options cont
6564
if err = c.Watch(
6665
&source.Kind{Type: &clusterv1.Cluster{}},
6766
&handler.EnqueueRequestsFromMapFunc{
68-
ToRequests: util.ClusterToInfrastructureMapFunc(azCluster.GroupVersionKind()),
67+
ToRequests: util.ClusterToInfrastructureMapFunc(infrav1.GroupVersion.WithKind("AzureCluster")),
6968
},
7069
predicates.ClusterUnpaused(r.Log),
7170
); err != nil {

0 commit comments

Comments
 (0)