Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Dr. Stefan Schimanski <[email protected]>

Kubernetes-commit: 68226b0501996fc86c9c2bddb7d61e6a64c91304
  • Loading branch information
sttts authored and k8s-publishing-bot committed Jul 23, 2024
1 parent 437d97a commit 6f8e3bd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions coordination/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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.
Expand All @@ -55,24 +55,26 @@ 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.
// The list is ordered, and the first strategy supersedes all other strategies. The list is used by coordinated
// 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.
Expand Down

0 comments on commit 6f8e3bd

Please sign in to comment.