Skip to content

Commit

Permalink
Wait for initial cache to sync before starting autoscaling
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicbozzuto committed Oct 21, 2024
1 parent 7d051cc commit f33d5c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,11 @@ func buildAutoscaler(debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter
// additional informers might have been registered in the factory during NewAutoscaler.
stop := make(chan struct{})
informerFactory.Start(stop)
klog.V(1).Info("Started shared informer factory, waiting for initial cache sync")

syncStart := time.Now()
informerFactory.WaitForCacheSync(stop)
klog.V(1).Infof("Shared informer factory initialized, took %v", time.Since(syncStart))

return autoscaler, nil
}
Expand Down

0 comments on commit f33d5c5

Please sign in to comment.