@@ -75,8 +75,10 @@ type managerOpts struct {
7575 WatchFilterValue string
7676 CertDir string
7777
78- CloudStackClusterConcurrency int
79- CloudStackMachineConcurrency int
78+ CloudStackClusterConcurrency int
79+ CloudStackMachineConcurrency int
80+ CloudStackAffinityGroupConcurrency int
81+ CloudStackFailureDomainConcurrency int
8082}
8183
8284func setFlags () * managerOpts {
@@ -133,6 +135,18 @@ func setFlags() *managerOpts {
133135 10 ,
134136 "Maximum concurrent reconciles for CloudStackMachine resources" ,
135137 )
138+ flag .IntVar (
139+ & opts .CloudStackAffinityGroupConcurrency ,
140+ "cloudstackaffinitygroup-concurrency" ,
141+ 1 ,
142+ "Maximum concurrent reconciles for CloudStackAffinityGroup resources" ,
143+ )
144+ flag .IntVar (
145+ & opts .CloudStackFailureDomainConcurrency ,
146+ "cloudstackfailuredomain-concurrency" ,
147+ 1 ,
148+ "Maximum concurrent reconciles for CloudStackFailureDomain resources" ,
149+ )
136150
137151 return opts
138152}
@@ -222,11 +236,11 @@ func setupReconcilers(ctx context.Context, base utils.ReconcilerBase, opts manag
222236 setupLog .Error (err , "unable to create controller" , "controller" , "CloudStackIsoNetReconciler" )
223237 os .Exit (1 )
224238 }
225- if err := (& controllers.CloudStackAffinityGroupReconciler {ReconcilerBase : base }).SetupWithManager (mgr ); err != nil {
239+ if err := (& controllers.CloudStackAffinityGroupReconciler {ReconcilerBase : base }).SetupWithManager (mgr , controller. Options { MaxConcurrentReconciles : opts . CloudStackAffinityGroupConcurrency } ); err != nil {
226240 setupLog .Error (err , "unable to create controller" , "controller" , "CloudStackAffinityGroup" )
227241 os .Exit (1 )
228242 }
229- if err := (& controllers.CloudStackFailureDomainReconciler {ReconcilerBase : base }).SetupWithManager (mgr ); err != nil {
243+ if err := (& controllers.CloudStackFailureDomainReconciler {ReconcilerBase : base }).SetupWithManager (mgr , controller. Options { MaxConcurrentReconciles : opts . CloudStackFailureDomainConcurrency } ); err != nil {
230244 setupLog .Error (err , "unable to create controller" , "controller" , "CloudStackFailureDomain" )
231245 os .Exit (1 )
232246 }
0 commit comments