From 8a645f63cf6a8c13f3b29e940c35e90900d6deec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 24 Jan 2023 18:43:48 +0100 Subject: [PATCH] fix: don't release lock on context cancelled (#6048) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché Signed-off-by: Charles-Edouard Brétéché --- pkg/leaderelection/leaderelection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/leaderelection/leaderelection.go b/pkg/leaderelection/leaderelection.go index 50107f788e..aefd6e9c0d 100644 --- a/pkg/leaderelection/leaderelection.go +++ b/pkg/leaderelection/leaderelection.go @@ -73,7 +73,7 @@ func New(log logr.Logger, name, namespace string, kubeClient kubernetes.Interfac } e.leaderElectionCfg = leaderelection.LeaderElectionConfig{ Lock: e.lock, - ReleaseOnCancel: true, + ReleaseOnCancel: false, LeaseDuration: 6 * retryPeriod, RenewDeadline: 5 * retryPeriod, RetryPeriod: retryPeriod,