Skip to content

Commit

Permalink
fix: Update config for metrics, throttler, and entrypoint. Fixes #11542
Browse files Browse the repository at this point in the history
…, #11541 (#11553)

Signed-off-by: Yuan Tang <[email protected]>
  • Loading branch information
terrytangyuan committed Aug 10, 2023
1 parent 43f15c6 commit 19674de
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions workflow/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ func NewWorkflowController(ctx context.Context, restConfig *rest.Config, kubecli
wfc.executorPlugins = map[string]map[string]*spec.Plugin{}
}

wfc.UpdateConfig(ctx)
wfc.metrics = metrics.New(wfc.getMetricsServerConfig())
wfc.entrypoint = entrypoint.New(kubeclientset, wfc.Config.Images)

workqueue.SetProvider(wfc.metrics) // must execute SetProvider before we created the queues
wfc.wfQueue = wfc.metrics.RateLimiterWithBusyWorkers(&fixedItemIntervalRateLimiter{}, "workflow_queue")
wfc.throttler = wfc.newThrottler()
wfc.podCleanupQueue = wfc.metrics.RateLimiterWithBusyWorkers(workqueue.DefaultControllerRateLimiter(), "pod_cleanup_queue")

return &wfc, nil
Expand Down Expand Up @@ -238,11 +240,6 @@ var indexers = cache.Indexers{
func (wfc *WorkflowController) Run(ctx context.Context, wfWorkers, workflowTTLWorkers, podCleanupWorkers, cronWorkflowWorkers int) {
defer runtimeutil.HandleCrash(runtimeutil.PanicHandlers...)

// init DB after leader election (if enabled)
wfc.UpdateConfig(ctx)
// init throttler after update config
wfc.throttler = wfc.newThrottler()

ctx, cancel := context.WithCancel(ctx)
defer cancel()

Expand Down

0 comments on commit 19674de

Please sign in to comment.