Skip to content

Commit

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

Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
  • Loading branch information
terrytangyuan authored and dpadhiar committed May 9, 2024
1 parent ea83b04 commit 9df499f
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 @@ -187,11 +187,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 @@ -237,11 +239,6 @@ var indexers = cache.Indexers{
func (wfc *WorkflowController) Run(ctx context.Context, wfWorkers, workflowTTLWorkers, podCleanupWorkers 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 9df499f

Please sign in to comment.