Revert "Add fast-path for Listing with ResourceVersion=0"

pull/6/head
Antoine Pelisse 2016-11-18 14:15:08 -08:00 committed by GitHub
parent 38ec2974a2
commit e7bc178829
1 changed files with 4 additions and 7 deletions

View File

@ -283,13 +283,10 @@ func (w *watchCache) waitUntilFreshAndBlock(resourceVersion uint64, trace *util.
// WaitUntilFreshAndList returns list of pointers to <storeElement> objects.
func (w *watchCache) WaitUntilFreshAndList(resourceVersion uint64, trace *util.Trace) ([]interface{}, uint64, error) {
// If resourceVersion == 0 we'll return the data that we currently have in cache.
if resourceVersion != 0 {
err := w.waitUntilFreshAndBlock(resourceVersion, trace)
defer w.RUnlock()
if err != nil {
return nil, 0, err
}
err := w.waitUntilFreshAndBlock(resourceVersion, trace)
defer w.RUnlock()
if err != nil {
return nil, 0, err
}
return w.store.List(), w.resourceVersion, nil
}