From 4151007d8ca6ea627d35bc32814939367a715a6d Mon Sep 17 00:00:00 2001 From: Oliver T Date: Tue, 7 Sep 2021 19:03:56 -0400 Subject: [PATCH] Migrates leader election to Lease API I ran `make test` and got no errors back, I also ran the `tests/e2e/test.sh` script and the process completed successfully. I believe this change completes the migration to the Lease API but I'm not entirely certain. If someone can verify this and/or provide any other feedback I'll greatly appreciate it! --- controller/controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/controller.go b/controller/controller.go index 877d1de..758c7d6 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -864,11 +864,11 @@ func (ctrl *ProvisionController) Run(ctx context.Context) { go ctrl.volumeStore.Run(ctx, DefaultThreadiness) if ctrl.leaderElection { - rl, err := resourcelock.New("endpoints", + rl, err := resourcelock.New("leases", ctrl.leaderElectionNamespace, strings.Replace(ctrl.provisionerName, "/", "-", -1), - ctrl.client.CoreV1(), nil, + ctrl.client.CoordinationV1(), resourcelock.ResourceLockConfig{ Identity: ctrl.id, EventRecorder: ctrl.eventRecorder,