Skip to content

Commit

Permalink
fix: Workflow controller crash on nil pointer (#11770)
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw99 authored Sep 7, 2023
1 parent 1f2e822 commit 75bd0b8
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 75bd0b8

Please sign in to comment.