@@ -22,6 +22,7 @@ import (
22
22
"reflect"
23
23
24
24
ctrl "sigs.k8s.io/controller-runtime"
25
+ "sigs.k8s.io/controller-runtime/pkg/controller"
25
26
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
26
27
"sigs.k8s.io/controller-runtime/pkg/event"
27
28
"sigs.k8s.io/controller-runtime/pkg/handler"
@@ -129,7 +130,8 @@ func (r *CloudStackClusterReconciliationRunner) SetFailureDomainsStatusMap() (ct
129
130
for _ , fdSpec := range r .ReconciliationSubject .Spec .FailureDomains {
130
131
metaHashName := infrav1 .FailureDomainHashedMetaName (fdSpec .Name , r .CAPICluster .Name )
131
132
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
+ }
133
135
}
134
136
return ctrl.Result {}, nil
135
137
}
@@ -153,8 +155,9 @@ func (r *CloudStackClusterReconciliationRunner) ReconcileDelete() (ctrl.Result,
153
155
}
154
156
155
157
// 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 {
157
159
controller , err := ctrl .NewControllerManagedBy (mgr ).
160
+ WithOptions (opts ).
158
161
For (& infrav1.CloudStackCluster {}).
159
162
WithEventFilter (
160
163
predicate.Funcs {
@@ -194,6 +197,7 @@ func (reconciler *CloudStackClusterReconciler) SetupWithManager(ctx context.Cont
194
197
return oldCluster .Spec .Paused && ! newCluster .Spec .Paused
195
198
},
196
199
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
+ })
198
202
return errors .Wrap (err , "building CloudStackCluster controller" )
199
203
}
0 commit comments