mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-17 23:57:52 +00:00
chore(leader-election): modify leader-election comment to OnStoppedLeading callback is always called when the LeaderElector exits, even if it did not start leading.
Kubernetes-commit: 7d2fbc7cfd49bca7d58160ed25dfd1f838629bb9
This commit is contained in:
committed by
Kubernetes Publisher
parent
d680385f61
commit
1b8aded77b
@@ -173,7 +173,10 @@ type LeaderElectionConfig struct {
|
||||
type LeaderCallbacks struct {
|
||||
// OnStartedLeading is called when a LeaderElector client starts leading
|
||||
OnStartedLeading func(context.Context)
|
||||
// OnStoppedLeading is called when a LeaderElector client stops leading
|
||||
// OnStoppedLeading is called when a LeaderElector client stops leading.
|
||||
// This callback is always called when the LeaderElector exits, even if it did not start leading.
|
||||
// Users should not assume that OnStoppedLeading is only called after OnStartedLeading.
|
||||
// see: https://github.com/kubernetes/kubernetes/pull/127675#discussion_r1780059887
|
||||
OnStoppedLeading func()
|
||||
// OnNewLeader is called when the client observes a leader that is
|
||||
// not the previously observed leader. This includes the first observed
|
||||
|
Reference in New Issue
Block a user