@@ -25,7 +25,7 @@ import (
2525// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2626// +k8s:prerelease-lifecycle-gen:introduced=1.31
2727
28- // LeaseCandidate defines a candidate for a lease object.
28+ // LeaseCandidate defines a candidate for a Lease object.
2929// Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.
3030type LeaseCandidate struct {
3131 metav1.TypeMeta `json:",inline"`
@@ -39,7 +39,7 @@ type LeaseCandidate struct {
3939 Spec LeaseCandidateSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
4040}
4141
42- // LeaseSpec is a specification of a Lease.
42+ // LeaseCandidateSpec is a specification of a Lease.
4343type LeaseCandidateSpec struct {
4444 // LeaseName is the name of the lease for which this candidate is contending.
4545 // This field is immutable.
@@ -55,24 +55,26 @@ type LeaseCandidateSpec struct {
5555 // Any time a Lease needs to do leader election, the PingTime field
5656 // is updated to signal to the LeaseCandidate that they should update
5757 // the RenewTime.
58- // Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew.
58+ // Old LeaseCandidate objects are also garbage collected if it has been hours
59+ // since the last renew. The PingTime field is updated regularly to prevent
60+ // garbage collection for still active LeaseCandidates.
5961 // +optional
6062 RenewTime * metav1.MicroTime `json:"renewTime,omitempty" protobuf:"bytes,3,opt,name=renewTime"`
6163 // BinaryVersion is the binary version. It must be in a semver format without leading `v`.
62- // This field is required when Strategy is "OldestEmulationVersion"
64+ // This field is required when strategy is "OldestEmulationVersion"
6365 // +optional
6466 BinaryVersion string `json:"binaryVersion,omitempty" protobuf:"bytes,4,opt,name=binaryVersion"`
6567 // EmulationVersion is the emulation version. It must be in a semver format without leading `v`.
6668 // EmulationVersion must be less than or equal to BinaryVersion.
67- // This field is required when Strategy is "OldestEmulationVersion"
69+ // This field is required when strategy is "OldestEmulationVersion"
6870 // +optional
6971 EmulationVersion string `json:"emulationVersion,omitempty" protobuf:"bytes,5,opt,name=emulationVersion"`
7072 // PreferredStrategies indicates the list of strategies for picking the leader for coordinated leader election.
7173 // The list is ordered, and the first strategy supersedes all other strategies. The list is used by coordinated
7274 // leader election to make a decision about the final election strategy. This follows as
7375 // - If all clients have strategy X as the first element in this list, strategy X will be used.
7476 // - If a candidate has strategy [X] and another candidate has strategy [Y, X], Y supersedes X and strategy Y
75- // will be used
77+ // will be used.
7678 // - If a candidate has strategy [X, Y] and another candidate has strategy [Y, X], this is a user error and leader
7779 // election will not operate the Lease until resolved.
7880 // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
0 commit comments