Merge pull request #20269 from mqliang/sync-delta-fifo

add a HasSynced() for DeltaFIFO and FIFO, method, which is very helpful for Informer
This commit is contained in:
Daniel Smith
2016-02-05 15:51:50 -08:00
5 changed files with 170 additions and 6 deletions

View File

@@ -99,12 +99,7 @@ func (c *Controller) Run(stopCh <-chan struct{}) {
// Returns true once this controller has completed an initial resource listing
func (c *Controller) HasSynced() bool {
c.reflectorMutex.RLock()
defer c.reflectorMutex.RUnlock()
if c.reflector == nil {
return false
}
return c.reflector.LastSyncResourceVersion() != ""
return c.config.Queue.HasSynced()
}
// Requeue adds the provided object back into the queue if it does not already exist.