Skip to content

Commit

Permalink
Revert "Add fast-path for Listing with ResourceVersion=0"
Browse files Browse the repository at this point in the history
  • Loading branch information
apelisse authored Nov 18, 2016
1 parent 38ec297 commit e7bc178
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/storage/watch_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e7bc178

Please sign in to comment.