Merge pull request #139242 from liyuerich/commentstartcoordination

enable commentstart check on coordination API group

Kubernetes-commit: 126bbe7c9b36e6db9287a2e1bd1fbc79d6b27007
This commit is contained in:
Kubernetes Publisher
2026-07-07 19:42:42 +00:00
10 changed files with 23 additions and 19 deletions

View File

@@ -33,6 +33,7 @@ import (
// Lease defines a lease concept.
type LeaseApplyConfiguration struct {
metav1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// spec contains the specification of the Lease.

View File

@@ -44,11 +44,11 @@ type LeaseSpecApplyConfiguration struct {
// leaseTransitions is the number of transitions of a lease between
// holders.
LeaseTransitions *int32 `json:"leaseTransitions,omitempty"`
// Strategy indicates the strategy for picking the leader for coordinated leader election.
// strategy indicates the strategy for picking the leader for coordinated leader election.
// If the field is not specified, there is no active coordination for this lease.
// (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"`
// PreferredHolder signals to a lease holder that the lease has a
// preferredHolder signals to a lease holder that the lease has a
// more optimal holder and should be given up.
// This field can only be set if Strategy is also set.
PreferredHolder *string `json:"preferredHolder,omitempty"`

View File

@@ -34,6 +34,7 @@ import (
// Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.
type LeaseCandidateApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// spec contains the specification of the Lease.

View File

@@ -28,15 +28,15 @@ import (
//
// LeaseCandidateSpec is a specification of a Lease.
type LeaseCandidateSpecApplyConfiguration struct {
// LeaseName is the name of the lease for which this candidate is contending.
// leaseName is the name of the lease for which this candidate is contending.
// This field is immutable.
LeaseName *string `json:"leaseName,omitempty"`
// PingTime is the last time that the server has requested the LeaseCandidate
// pingTime is the last time that the server has requested the LeaseCandidate
// to renew. It is only done during leader election to check if any
// LeaseCandidates have become ineligible. When PingTime is updated, the
// LeaseCandidate will respond by updating RenewTime.
PingTime *v1.MicroTime `json:"pingTime,omitempty"`
// RenewTime is the time that the LeaseCandidate was last updated.
// renewTime is the time that the LeaseCandidate was last updated.
// 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.
@@ -44,14 +44,14 @@ type LeaseCandidateSpecApplyConfiguration struct {
// since the last renew. The PingTime field is updated regularly to prevent
// garbage collection for still active LeaseCandidates.
RenewTime *v1.MicroTime `json:"renewTime,omitempty"`
// BinaryVersion is the binary version. It must be in a semver format without leading `v`.
// binaryVersion is the binary version. It must be in a semver format without leading `v`.
// This field is required.
BinaryVersion *string `json:"binaryVersion,omitempty"`
// EmulationVersion is the emulation version. It must be in a semver format without leading `v`.
// 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"
EmulationVersion *string `json:"emulationVersion,omitempty"`
// Strategy is the strategy that coordinated leader election will use for picking the leader.
// strategy is the strategy that coordinated leader election will use for picking the leader.
// If multiple candidates for the same Lease return different strategies, the strategy provided
// by the candidate with the latest BinaryVersion will be used. If there is still conflict,
// this is a user error and coordinated leader election will not operate the Lease until resolved.

View File

@@ -33,6 +33,7 @@ import (
// Lease defines a lease concept.
type LeaseApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// spec contains the specification of the Lease.

View File

@@ -34,6 +34,7 @@ import (
// Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.
type LeaseCandidateApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:""`
// metadata is the standard object metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
// spec contains the specification of the Lease.

View File

@@ -28,17 +28,17 @@ import (
//
// LeaseCandidateSpec is a specification of a Lease.
type LeaseCandidateSpecApplyConfiguration struct {
// LeaseName is the name of the lease for which this candidate is contending.
// leaseName is the name of the lease for which this candidate is contending.
// The limits on this field are the same as on Lease.name. Multiple lease candidates
// may reference the same Lease.name.
// This field is immutable.
LeaseName *string `json:"leaseName,omitempty"`
// PingTime is the last time that the server has requested the LeaseCandidate
// pingTime is the last time that the server has requested the LeaseCandidate
// to renew. It is only done during leader election to check if any
// LeaseCandidates have become ineligible. When PingTime is updated, the
// LeaseCandidate will respond by updating RenewTime.
PingTime *v1.MicroTime `json:"pingTime,omitempty"`
// RenewTime is the time that the LeaseCandidate was last updated.
// renewTime is the time that the LeaseCandidate was last updated.
// 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.
@@ -46,14 +46,14 @@ type LeaseCandidateSpecApplyConfiguration struct {
// since the last renew. The PingTime field is updated regularly to prevent
// garbage collection for still active LeaseCandidates.
RenewTime *v1.MicroTime `json:"renewTime,omitempty"`
// BinaryVersion is the binary version. It must be in a semver format without leading `v`.
// binaryVersion is the binary version. It must be in a semver format without leading `v`.
// This field is required.
BinaryVersion *string `json:"binaryVersion,omitempty"`
// EmulationVersion is the emulation version. It must be in a semver format without leading `v`.
// 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"
EmulationVersion *string `json:"emulationVersion,omitempty"`
// Strategy is the strategy that coordinated leader election will use for picking the leader.
// strategy is the strategy that coordinated leader election will use for picking the leader.
// If multiple candidates for the same Lease return different strategies, the strategy provided
// by the candidate with the latest BinaryVersion will be used. If there is still conflict,
// this is a user error and coordinated leader election will not operate the Lease until resolved.

View File

@@ -44,10 +44,10 @@ type LeaseSpecApplyConfiguration struct {
// leaseTransitions is the number of transitions of a lease between
// holders.
LeaseTransitions *int32 `json:"leaseTransitions,omitempty"`
// Strategy indicates the strategy for picking the leader for coordinated leader election
// strategy indicates the strategy for picking the leader for coordinated leader election.
// (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"`
// PreferredHolder signals to a lease holder that the lease has a
// preferredHolder signals to a lease holder that the lease has a
// more optimal holder and should be given up.
PreferredHolder *string `json:"preferredHolder,omitempty"`
}

2
go.mod
View File

@@ -23,7 +23,7 @@ require (
golang.org/x/time v0.15.0
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af
gopkg.in/evanphx/json-patch.v4 v4.13.0
k8s.io/api v0.0.0-20260706230826-3616d63decdf
k8s.io/api v0.0.0-20260707215943-df8c8ab1bcaa
k8s.io/apimachinery v0.0.0-20260702204942-514a87090e39
k8s.io/klog/v2 v2.140.0
k8s.io/kube-openapi v0.0.0-20260618221249-bc653b64f974

4
go.sum
View File

@@ -118,8 +118,8 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20260706230826-3616d63decdf h1:7oKqZJ/5wJ3/zadI7UVYj5rvaJ9/vfzjMpeOZtW71p4=
k8s.io/api v0.0.0-20260706230826-3616d63decdf/go.mod h1:OA/OIhDDa5H8ARHTB6tn9X01K98YVtNU/klALfggRwk=
k8s.io/api v0.0.0-20260707215943-df8c8ab1bcaa h1:I3wYD4O+J6kBKlJHc77VrOtt2RKLmJZQ8i/Q2kN0OF4=
k8s.io/api v0.0.0-20260707215943-df8c8ab1bcaa/go.mod h1:OA/OIhDDa5H8ARHTB6tn9X01K98YVtNU/klALfggRwk=
k8s.io/apimachinery v0.0.0-20260702204942-514a87090e39 h1:w6LmMiDJ3PrOhGIxdLs4Itjcp9nvmEycztaHbZDSu5Y=
k8s.io/apimachinery v0.0.0-20260702204942-514a87090e39/go.mod h1:T9tvL1Yxf+TRVyTz+Q7KtLAncCr9xxxx1zrF6g/QuR0=
k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=