Skip to content

Commit

Permalink
create flag for concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
lubedacht committed Jul 11, 2024
1 parent 05190d8 commit 8f13327
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ var (
enableLeaderElection bool
diagnosticOptions = flags.DiagnosticsOptions{}

icClusterConcurrency int
icMachineConcurrency int
icClusterConcurrency int
icMachineConcurrency int
icLoadBalancerConcurrency int
)

func init() {
Expand Down Expand Up @@ -108,7 +109,7 @@ func main() {
if err = iccontroller.NewIonosCloudLoadBalancerReconciler(mgr).SetupWithManager(
ctx,
mgr,
controller.Options{MaxConcurrentReconciles: 1}, // TODO create config for this
controller.Options{MaxConcurrentReconciles: icLoadBalancerConcurrency},
); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "IonosCloudLoadBalancer")
os.Exit(1)
Expand Down Expand Up @@ -146,4 +147,6 @@ func initFlags() {
"Number of IonosCloudClusters to process simultaneously")
pflag.IntVar(&icMachineConcurrency, "ionoscloudmachine-concurrency", 1,
"Number of IonosCloudMachines to process simultaneously")
pflag.IntVar(&icLoadBalancerConcurrency, "ionoscloudloadbalancer-concurrency", 1,
"Number of IonosCloudLoadBalancers to process simultaneously")
}

0 comments on commit 8f13327

Please sign in to comment.