Skip to content

Commit

Permalink
fix: Argo DB init conflict when deploy workflow-controller with multi…
Browse files Browse the repository at this point in the history
…ple replicas #11177 (#11178)

Signed-off-by: astraw99 <wangchengiscool@gmail.com>
  • Loading branch information
astraw99 authored and terrytangyuan committed Jul 19, 2023
1 parent 1222da4 commit f7b3072
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions workflow/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ 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)

Expand Down Expand Up @@ -240,6 +238,9 @@ 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)

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

Expand Down

0 comments on commit f7b3072

Please sign in to comment.