@@ -22,6 +22,7 @@ import (
2222 "reflect"
2323
2424 ctrl "sigs.k8s.io/controller-runtime"
25+ "sigs.k8s.io/controller-runtime/pkg/controller"
2526 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
2627 "sigs.k8s.io/controller-runtime/pkg/event"
2728 "sigs.k8s.io/controller-runtime/pkg/handler"
@@ -129,7 +130,8 @@ func (r *CloudStackClusterReconciliationRunner) SetFailureDomainsStatusMap() (ct
129130 for _ , fdSpec := range r .ReconciliationSubject .Spec .FailureDomains {
130131 metaHashName := infrav1 .FailureDomainHashedMetaName (fdSpec .Name , r .CAPICluster .Name )
131132 r .ReconciliationSubject .Status .FailureDomains [fdSpec .Name ] = clusterv1.FailureDomainSpec {
132- ControlPlane : true , Attributes : map [string ]string {"MetaHashName" : metaHashName }}
133+ ControlPlane : true , Attributes : map [string ]string {"MetaHashName" : metaHashName },
134+ }
133135 }
134136 return ctrl.Result {}, nil
135137}
@@ -153,8 +155,9 @@ func (r *CloudStackClusterReconciliationRunner) ReconcileDelete() (ctrl.Result,
153155}
154156
155157// Called in main, this registers the cluster reconciler to the CAPI controller manager.
156- func (reconciler * CloudStackClusterReconciler ) SetupWithManager (ctx context.Context , mgr ctrl.Manager ) error {
158+ func (reconciler * CloudStackClusterReconciler ) SetupWithManager (ctx context.Context , mgr ctrl.Manager , opts controller. Options ) error {
157159 controller , err := ctrl .NewControllerManagedBy (mgr ).
160+ WithOptions (opts ).
158161 For (& infrav1.CloudStackCluster {}).
159162 WithEventFilter (
160163 predicate.Funcs {
@@ -194,6 +197,7 @@ func (reconciler *CloudStackClusterReconciler) SetupWithManager(ctx context.Cont
194197 return oldCluster .Spec .Paused && ! newCluster .Spec .Paused
195198 },
196199 DeleteFunc : func (e event.DeleteEvent ) bool { return false },
197- CreateFunc : func (e event.CreateEvent ) bool { return false }})
200+ CreateFunc : func (e event.CreateEvent ) bool { return false },
201+ })
198202 return errors .Wrap (err , "building CloudStackCluster controller" )
199203}
0 commit comments