k3s-io / kine

Run Kubernetes on MySQL, Postgres, sqlite, dqlite, not etcd.
Apache License 2.0
1.56k stars 233 forks source link

Only enforce RangeEnd + Limit restriction when RangeEnd is set #126

Closed brandond closed 2 years ago

brandond commented 2 years ago

Related to: https://github.com/rancher/rancher/issues/36922 Caused by: https://github.com/kubernetes/kubernetes/pull/108569

Get requests with a field-selector now create range requests that include a limit (page size) that is managed by the apiserver. Kine was enforcing an unconditional restriction on the limit not being set, when the apparent intention was to only prohibit use of limit + rangeEnd at the same time.

Kubernetes 1.24 will when searching within a namespace for a resource using FieldSelector on metatada.name, send a Get request for the fully qualified resource name, but with a non-zero limit: RangeRequest Key=/registry/services/specs/default/kubernetes RangeEnd= Limit=500 Revision=0 SortOrder=0 SortTarget=0 Serializable=false KeysOnly=false CountOnly=false

Confirmed that this fixes use of fieldSelector with K3s 1.24.2