diff --git a/coordination/v1alpha1/types.go b/coordination/v1alpha1/types.go index 6af5b51fc..14066600c 100644 --- a/coordination/v1alpha1/types.go +++ b/coordination/v1alpha1/types.go @@ -25,7 +25,7 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.31 -// LeaseCandidate defines a candidate for a lease object. +// LeaseCandidate defines a candidate for a Lease object. // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. type LeaseCandidate struct { metav1.TypeMeta `json:",inline"` @@ -39,7 +39,7 @@ type LeaseCandidate struct { Spec LeaseCandidateSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } -// LeaseSpec is a specification of a Lease. +// LeaseCandidateSpec is a specification of a Lease. type LeaseCandidateSpec struct { // LeaseName is the name of the lease for which this candidate is contending. // This field is immutable. @@ -55,16 +55,18 @@ type LeaseCandidateSpec struct { // Any time a Lease needs to do leader election, the PingTime field // is updated to signal to the LeaseCandidate that they should update // the RenewTime. - // Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. + // Old LeaseCandidate objects are also garbage collected if it has been hours + // since the last renew. The PingTime field is updated regularly to prevent + // garbage collection for still active LeaseCandidates. // +optional RenewTime *metav1.MicroTime `json:"renewTime,omitempty" protobuf:"bytes,3,opt,name=renewTime"` // BinaryVersion is the binary version. It must be in a semver format without leading `v`. - // This field is required when Strategy is "OldestEmulationVersion" + // This field is required when strategy is "OldestEmulationVersion" // +optional BinaryVersion string `json:"binaryVersion,omitempty" protobuf:"bytes,4,opt,name=binaryVersion"` // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. // EmulationVersion must be less than or equal to BinaryVersion. - // This field is required when Strategy is "OldestEmulationVersion" + // This field is required when strategy is "OldestEmulationVersion" // +optional EmulationVersion string `json:"emulationVersion,omitempty" protobuf:"bytes,5,opt,name=emulationVersion"` // PreferredStrategies indicates the list of strategies for picking the leader for coordinated leader election. @@ -72,7 +74,7 @@ type LeaseCandidateSpec struct { // leader election to make a decision about the final election strategy. This follows as // - If all clients have strategy X as the first element in this list, strategy X will be used. // - If a candidate has strategy [X] and another candidate has strategy [Y, X], Y supersedes X and strategy Y - // will be used + // will be used. // - If a candidate has strategy [X, Y] and another candidate has strategy [Y, X], this is a user error and leader // election will not operate the Lease until resolved. // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.