Skip to content

Commit f71a5cc

Browse files
stttsk8s-publishing-bot
authored andcommitted
Call non-blocking informerFactory.Start synchronously to avoid races
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com> Kubernetes-commit: c7a1fa432a87579895eac4b3873162d5f1dba7f5
1 parent 4536e5a commit f71a5cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/leaderelection/leasecandidate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func NewCandidate(clientset kubernetes.Interface,
120120
func (c *LeaseCandidate) Run(ctx context.Context) {
121121
defer c.queue.ShutDown()
122122

123-
go c.informerFactory.Start(ctx.Done())
123+
c.informerFactory.Start(ctx.Done())
124124
if !cache.WaitForNamedCacheSync("leasecandidateclient", ctx.Done(), c.hasSynced) {
125125
return
126126
}

0 commit comments

Comments
 (0)