Skip to content

Commit

Permalink
fix: Workflow controller crash on nil pointer (argoproj#11770)
Browse files Browse the repository at this point in the history
Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
  • Loading branch information
astraw99 authored and dpadhiar committed May 9, 2024
1 parent cf496ea commit d072444
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions workflow/controller/healthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ func (wfc *WorkflowController) Healthz(w http.ResponseWriter, r *http.Request) {
if err != nil {
return err
}
// the wfc.wfInformer is nil if it is not the leader
if wfc.wfInformer == nil {
log.Info("healthz: current pod is not the leader")
return nil
}
lister := v1alpha1.NewWorkflowLister(wfc.wfInformer.GetIndexer())
list, err := lister.Workflows(wfc.managedNamespace).List(seletor)
if err != nil {
Expand Down

0 comments on commit d072444

Please sign in to comment.