Skip to content

Record leader transitions in leader election - #2770

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes-client:masterfrom
chala2001:lease-transitions
Nov 20, 2026
Merged

kubernetes-prow[bot] merged 1 commit into
kubernetes-client:masterfrom
chala2001:lease-transitions

Conversation

@chala2001

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Follow-up to #2690. Leader election now records the leader transition count, like client-go does. It's stored as spec.leaseTransitions on a Lease and leaderTransitions on a ConfigMap. The leader keeps the count on renew, and it goes up by one when another candidate takes the lock.

Locks without the field read as 0.

Which issue(s) this PR fixes:

Follow-up to #2690

Special notes for your reviewer:

Sync client only. Happy to do the asyncio one next.

Does this PR introduce a user-facing change?

Leader election now records leader transitions in the lock.

@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 4, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from roycaihw and yliaog November 4, 2026 18:46
@roycaihw

roycaihw commented Nov 5, 2026

Copy link
Copy Markdown
Member

/assign

@chala2001

Copy link
Copy Markdown
Contributor Author

@roycaihw could you approve the workflow run? Thanks.

@chala2001

Copy link
Copy Markdown
Contributor Author

@yliaog could you please review this PR ?

@yliaog

yliaog commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

thanks for the PR
/lgtm
/approve

please file a separate PR for the asyncio client

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 20, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chala2001, yliaog

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 20, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 37df829 into kubernetes-client:master Nov 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants