diff --git a/pkg/controller/batchrelease/batchrelease_controller.go b/pkg/controller/batchrelease/batchrelease_controller.go index 98ed293..9da2012 100644 --- a/pkg/controller/batchrelease/batchrelease_controller.go +++ b/pkg/controller/batchrelease/batchrelease_controller.go @@ -52,6 +52,8 @@ var ( ) func init() { + flag.IntVar(&concurrentReconciles, "batchrelease-workers", 3, "Max concurrent workers for batchRelease controller.") + watchedWorkload = sync.Map{} watchedWorkload.LoadOrStore(util.ControllerKindDep.String(), struct{}{}) watchedWorkload.LoadOrStore(util.ControllerKindSts.String(), struct{}{}) @@ -62,10 +64,6 @@ func init() { const ReleaseFinalizer = "rollouts.kruise.io/batch-release-finalizer" -func init() { - flag.IntVar(&concurrentReconciles, "batchrelease-workers", concurrentReconciles, "Max concurrent workers for BatchRelease controller.") -} - // Add creates a new Rollout Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller // and Start it when the Manager is Started. func Add(mgr manager.Manager) error { diff --git a/pkg/controller/rollout/rollout_controller.go b/pkg/controller/rollout/rollout_controller.go index e87d25b..9751988 100644 --- a/pkg/controller/rollout/rollout_controller.go +++ b/pkg/controller/rollout/rollout_controller.go @@ -18,6 +18,7 @@ package rollout import ( "context" + "flag" "sync" "time" @@ -42,6 +43,8 @@ var ( ) func init() { + flag.IntVar(&concurrentReconciles, "rollout-workers", 3, "Max concurrent workers for rollout controller.") + watchedWorkload = sync.Map{} watchedWorkload.LoadOrStore(util.ControllerKindDep.String(), struct{}{}) watchedWorkload.LoadOrStore(util.ControllerKindSts.String(), struct{}{})