Skip to content

Commit c259fe2

Browse files
committed
flowcontrol/request/list_work_estimator: sync shouldDelegateList
1 parent 09e8598 commit c259fe2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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
@@ -173,10 +173,10 @@ func shouldListFromStorage(query url.Values, opts *metav1.ListOptions) bool {
173173
consistentReadFromStorage := resourceVersion == "" && !(consistentListFromCacheEnabled && requestWatchProgressSupported)
174174
// Watch cache doesn't support continuations, so serve them from etcd.
175175
hasContinuation := len(opts.Continue) > 0
176-
// Serve paginated requests about revision "0" from watch cache to avoid overwhelming etcd.
177-
hasLimit := opts.Limit > 0 && resourceVersion != "0"
178176
// Watch cache only supports ResourceVersionMatchNotOlderThan (default).
179-
unsupportedMatch := match != "" && match != metav1.ResourceVersionMatchNotOlderThan
177+
// see https://kubernetes.io/docs/reference/using-api/api-concepts/#semantics-for-get-and-list
178+
isLegacyExactMatch := opts.Limit > 0 && match == "" && len(resourceVersion) > 0 && resourceVersion != "0"
179+
unsupportedMatch := match != "" && match != metav1.ResourceVersionMatchNotOlderThan || isLegacyExactMatch
180180

181-
return consistentReadFromStorage || hasContinuation || hasLimit || unsupportedMatch
181+
return consistentReadFromStorage || hasContinuation || unsupportedMatch
182182
}

0 commit comments

Comments
 (0)