Merge pull request #1167 from carlory/simplify-waiting-code
simplify waitForCacheSync func
This commit is contained in:
commit
5136be2917
|
@ -193,15 +193,7 @@ func (es *AccurateSchedulerEstimatorServer) nodeMaxAvailableReplica(node *corev1
|
|||
}
|
||||
|
||||
func (es *AccurateSchedulerEstimatorServer) waitForCacheSync(stopCh <-chan struct{}) bool {
|
||||
return cache.WaitForCacheSync(stopCh,
|
||||
func() []cache.InformerSynced {
|
||||
informerSynced := []cache.InformerSynced{
|
||||
es.podInformer.Informer().HasSynced,
|
||||
es.nodeInformer.Informer().HasSynced,
|
||||
}
|
||||
return informerSynced
|
||||
}()...,
|
||||
)
|
||||
return cache.WaitForCacheSync(stopCh, es.podInformer.Informer().HasSynced, es.nodeInformer.Informer().HasSynced)
|
||||
}
|
||||
|
||||
func traceMaxAvailableReplicas(object string, start time.Time, request *pb.MaxAvailableReplicasRequest) func(response **pb.MaxAvailableReplicasResponse, err *error) {
|
||||
|
|
Loading…
Reference in New Issue