allow users define controller workers (#67)

Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>

Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
Co-authored-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
This commit is contained in:
Wei-Xiang Sun 2022-08-23 14:46:26 +08:00 committed by GitHub
parent 65b75a6615
commit 3d1df9c315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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 {

View File

@ -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{}{})