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
commit fa3ff38f95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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()
}
},
}