Skip to content

Commit

Permalink
Merge pull request #127834 from googs1025/fix/leaderelection/patch
Browse files Browse the repository at this point in the history
fix(leaderelection): nil check in OnStoppedLeading func
  • Loading branch information
k8s-ci-robot authored Oct 3, 2024
2 parents 8c22556 + b60cef2 commit fa3ff38
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 fa3ff38

Please sign in to comment.