Skip to content

Commit 593906d

Browse files
authored
Merge pull request kubernetes#130924 from serathius/watchcache-delegate-precedense
Change precedence order for continue and legacy exact match
2 parents 32260df + 7da942c commit 593906d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

staging/src/k8s.io/apiserver/pkg/storage/cacher/delegator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ func shouldDelegateList(opts storage.ListOptions, cache delegator.Helper) (deleg
257257
case metav1.ResourceVersionMatchNotOlderThan:
258258
return delegator.Result{ShouldDelegate: false}, nil
259259
case "":
260-
// Legacy exact match
261-
if opts.Predicate.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
262-
return cache.ShouldDelegateExactRV(opts.ResourceVersion, opts.Recursive)
263-
}
264260
// Continue
265261
if len(opts.Predicate.Continue) > 0 {
266262
return cache.ShouldDelegateContinue(opts.Predicate.Continue, opts.Recursive)
267263
}
264+
// Legacy exact match
265+
if opts.Predicate.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
266+
return cache.ShouldDelegateExactRV(opts.ResourceVersion, opts.Recursive)
267+
}
268268
// Consistent Read
269269
if opts.ResourceVersion == "" {
270270
return cache.ShouldDelegateConsistentRead()

staging/src/k8s.io/apiserver/pkg/util/flowcontrol/request/list_work_estimator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ func shouldDelegateList(opts *metav1.ListOptions, cache delegator.Helper) (deleg
172172
case metav1.ResourceVersionMatchNotOlderThan:
173173
return delegator.Result{ShouldDelegate: false}, nil
174174
case "":
175-
// Legacy exact match
176-
if opts.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
177-
return cache.ShouldDelegateExactRV(opts.ResourceVersion, defaultRecursive)
178-
}
179175
// Continue
180176
if len(opts.Continue) > 0 {
181177
return cache.ShouldDelegateContinue(opts.Continue, defaultRecursive)
182178
}
179+
// Legacy exact match
180+
if opts.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
181+
return cache.ShouldDelegateExactRV(opts.ResourceVersion, defaultRecursive)
182+
}
183183
// Consistent Read
184184
if opts.ResourceVersion == "" {
185185
return cache.ShouldDelegateConsistentRead()

0 commit comments

Comments
 (0)