Skip to content

Record leader transitions in leader election - #2770

Open
chala2001 wants to merge 1 commit into
kubernetes-client:masterfrom
chala2001:lease-transitions
Open

chala2001 wants to merge 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

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chala2001
Once this PR has been reviewed and has the lgtm label, please assign roycaihw for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 requested review from roycaihw and yliaog November 4, 2026 18:46
@roycaihw

roycaihw commented Nov 5, 2026

Copy link
Copy Markdown
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. 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.

2 participants