return early if has not synced
This commit is contained in:
@@ -409,6 +409,14 @@ func (rm *ReplicationManager) syncReplicationController(key string) error {
|
||||
glog.V(4).Infof("Finished syncing controller %q (%v)", key, time.Now().Sub(startTime))
|
||||
}()
|
||||
|
||||
if !rm.podStoreSynced() {
|
||||
// Sleep so we give the pod reflector goroutine a chance to run.
|
||||
time.Sleep(PodStoreSyncedPollPeriod)
|
||||
glog.Infof("Waiting for pods controller to sync, requeuing rc %v", key)
|
||||
rm.queue.Add(key)
|
||||
return nil
|
||||
}
|
||||
|
||||
obj, exists, err := rm.rcStore.Store.GetByKey(key)
|
||||
if !exists {
|
||||
glog.Infof("Replication Controller has been deleted %v", key)
|
||||
@@ -421,13 +429,6 @@ func (rm *ReplicationManager) syncReplicationController(key string) error {
|
||||
return err
|
||||
}
|
||||
rc := *obj.(*api.ReplicationController)
|
||||
if !rm.podStoreSynced() {
|
||||
// Sleep so we give the pod reflector goroutine a chance to run.
|
||||
time.Sleep(PodStoreSyncedPollPeriod)
|
||||
glog.Infof("Waiting for pods controller to sync, requeuing rc %v", rc.Name)
|
||||
rm.enqueueController(&rc)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check the expectations of the rc before counting active pods, otherwise a new pod can sneak in
|
||||
// and update the expectations after we've retrieved active pods from the store. If a new pod enters
|
||||
|
Reference in New Issue
Block a user