Skip to content
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

apply k8s leader election graceful release fix in vendor #3405

Merged
merged 1 commit into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions hack/k8s-client-go.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go 2020-07-02 11:15:19.000000000 -0400
+++ vendor/k8s.io/client-go/tools/leaderelection/leaderelection_new.go 2020-07-06 15:51:35.000000000 -0400
@@ -301,7 +301,8 @@
return true
}
leaderElectionRecord := rl.LeaderElectionRecord{
- LeaderTransitions: le.observedRecord.LeaderTransitions,
+ LeaderTransitions: le.observedRecord.LeaderTransitions,
+ LeaseDurationSeconds: le.observedRecord.LeaseDurationSeconds,
}
if err := le.config.Lock.Update(leaderElectionRecord); err != nil {
klog.Errorf("Failed to release lock: %v", err)
5 changes: 5 additions & 0 deletions hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@ find vendor/ -name '*_test.go'-delete
export GOFLAGS=-mod=vendor

update_licenses third_party/VENDOR-LICENSE "./..."


# Patch k8s leader-election fixing graceful release
# More information: https://github.com/kubernetes/kubernetes/pull/91942
patch vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go hack/k8s-client-go.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historically we've used git apply to avoid introducing new tooling dependencies here. This is making the auto-deps automation fail :(

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.