Merge pull request #127834 from googs1025/fix/leaderelection/patch

fix(leaderelection): nil check in OnStoppedLeading func
This commit is contained in:
Kubernetes Prow Robot
2024-10-03 23:22:30 +01:00
committed by GitHub

View File

@@ -50,7 +50,9 @@ func RunWithLeaderElection(ctx context.Context, config *rest.Config, newRunnerFn
run(ctx, 1)
},
OnStoppedLeading: func() {
cancel()
if cancel != nil {
cancel()
}
},
}