From 0bf5b5ab8feabb35a42a242a20af3f048862b49f Mon Sep 17 00:00:00 2001 From: astraw99 Date: Mon, 9 Aug 2021 10:48:53 +0800 Subject: [PATCH] unify worker num to workers Kubernetes-commit: e6df935fd30c56a8ece0da6152c60fc725d942b7 --- controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller.go b/controller.go index ab6ce035..f279db5d 100644 --- a/controller.go +++ b/controller.go @@ -148,7 +148,7 @@ func NewController( // as syncing informer caches and starting workers. It will block until stopCh // is closed, at which point it will shutdown the workqueue and wait for // workers to finish processing their current work items. -func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error { +func (c *Controller) Run(workers int, stopCh <-chan struct{}) error { defer utilruntime.HandleCrash() defer c.workqueue.ShutDown() @@ -163,7 +163,7 @@ func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error { klog.Info("Starting workers") // Launch two workers to process Foo resources - for i := 0; i < threadiness; i++ { + for i := 0; i < workers; i++ { go wait.Until(c.runWorker, time.Second, stopCh) }