From f71a5cc5d3520ba293e5a571c107cd56ccefb5fe Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Sat, 27 Jul 2024 16:13:16 +0200 Subject: [PATCH] Call non-blocking informerFactory.Start synchronously to avoid races Signed-off-by: Dr. Stefan Schimanski Kubernetes-commit: c7a1fa432a87579895eac4b3873162d5f1dba7f5 --- tools/leaderelection/leasecandidate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/leaderelection/leasecandidate.go b/tools/leaderelection/leasecandidate.go index c75fc3bdf..74cf5bb5c 100644 --- a/tools/leaderelection/leasecandidate.go +++ b/tools/leaderelection/leasecandidate.go @@ -120,7 +120,7 @@ func NewCandidate(clientset kubernetes.Interface, func (c *LeaseCandidate) Run(ctx context.Context) { defer c.queue.ShutDown() - go c.informerFactory.Start(ctx.Done()) + c.informerFactory.Start(ctx.Done()) if !cache.WaitForNamedCacheSync("leasecandidateclient", ctx.Done(), c.hasSynced) { return }