Skip to content

Commit

Permalink
Merge pull request #128340 from googs1025/automated-cherry-pick-of-#1…
Browse files Browse the repository at this point in the history
…27834-upstream-release-1.31

Automated cherry pick of #127834: fix(leaderelection): nil check in OnStoppedLeading func
  • Loading branch information
k8s-ci-robot authored Nov 12, 2024
2 parents f7d6fad + c94baac commit 11d2b4d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ func RunWithLeaderElection(ctx context.Context, config *rest.Config, newRunnerFn
run(ctx, 1)
},
OnStoppedLeading: func() {
cancel()
if cancel != nil {
cancel()
}
},
}

Expand Down

0 comments on commit 11d2b4d

Please sign in to comment.