Skip to content

Commit

Permalink
Call non-blocking informerFactory.Start synchronously to avoid races
Browse files Browse the repository at this point in the history
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>

Kubernetes-commit: c7a1fa432a87579895eac4b3873162d5f1dba7f5
  • Loading branch information
sttts authored and k8s-publishing-bot committed Jul 27, 2024
1 parent 4536e5a commit f71a5cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/leaderelection/leasecandidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f71a5cc

Please sign in to comment.