mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #130924 from serathius/watchcache-delegate-precedense
Change precedence order for continue and legacy exact match
This commit is contained in:
commit
593906d607
@ -257,14 +257,14 @@ func shouldDelegateList(opts storage.ListOptions, cache delegator.Helper) (deleg
|
||||
case metav1.ResourceVersionMatchNotOlderThan:
|
||||
return delegator.Result{ShouldDelegate: false}, nil
|
||||
case "":
|
||||
// Legacy exact match
|
||||
if opts.Predicate.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
|
||||
return cache.ShouldDelegateExactRV(opts.ResourceVersion, opts.Recursive)
|
||||
}
|
||||
// Continue
|
||||
if len(opts.Predicate.Continue) > 0 {
|
||||
return cache.ShouldDelegateContinue(opts.Predicate.Continue, opts.Recursive)
|
||||
}
|
||||
// Legacy exact match
|
||||
if opts.Predicate.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
|
||||
return cache.ShouldDelegateExactRV(opts.ResourceVersion, opts.Recursive)
|
||||
}
|
||||
// Consistent Read
|
||||
if opts.ResourceVersion == "" {
|
||||
return cache.ShouldDelegateConsistentRead()
|
||||
|
@ -172,14 +172,14 @@ func shouldDelegateList(opts *metav1.ListOptions, cache delegator.Helper) (deleg
|
||||
case metav1.ResourceVersionMatchNotOlderThan:
|
||||
return delegator.Result{ShouldDelegate: false}, nil
|
||||
case "":
|
||||
// Legacy exact match
|
||||
if opts.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
|
||||
return cache.ShouldDelegateExactRV(opts.ResourceVersion, defaultRecursive)
|
||||
}
|
||||
// Continue
|
||||
if len(opts.Continue) > 0 {
|
||||
return cache.ShouldDelegateContinue(opts.Continue, defaultRecursive)
|
||||
}
|
||||
// Legacy exact match
|
||||
if opts.Limit > 0 && len(opts.ResourceVersion) > 0 && opts.ResourceVersion != "0" {
|
||||
return cache.ShouldDelegateExactRV(opts.ResourceVersion, defaultRecursive)
|
||||
}
|
||||
// Consistent Read
|
||||
if opts.ResourceVersion == "" {
|
||||
return cache.ShouldDelegateConsistentRead()
|
||||
|
Loading…
Reference in New Issue
Block a user