-
Notifications
You must be signed in to change notification settings - Fork 40.6k
feat: Allow leases to have custom labels set when a new holder takes the lease #131632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Welcome @DerekFrank! |
Hi @DerekFrank. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: DerekFrank The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
9e6551b
to
b63166c
Compare
/test pull-kubernetes-e2e-kind |
/cc @Jefftree |
/triage accepted |
b63166c
to
501d207
Compare
staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go
Show resolved
Hide resolved
501d207
to
8597aba
Compare
e2e failing due to a 502 response from google.com. I'm going to guess thats a flake? |
/retest |
84c947b
to
9ca18a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock_test.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock_test.go
Show resolved
Hide resolved
9ca18a2
to
a89b7b7
Compare
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds unit tests for the leaselock class, and slightly modifies the functionality to allow users to set custom labels that are updated when a lease gets a new leader.
The intended use of this feature is to allow graceful fail away from leaders. Right now understanding which replica holds a lease is complicated as the holder identity is merely the name of the pod. This would simplify the process to understand who holds the lease without having to backtrace that information through the pod's host names. It also prevents race conditions from other workarounds such as custom controllers that reconcile on leases and update labels.
Which issue(s) this PR fixes:
Fixes kubernetes/client-go#1413
Special notes for your reviewer:
Does this PR introduce a user-facing change?
This change is technically user facing, as users can now leverage the functionality, but there is no action necessary. If a release note is required, I would say a note such as
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: