cozystack/pkg
Andrei Kvapil 88f469b3cd
fix(registry): implement field selector filtering for label-based resources
Controller-runtime cache doesn't support field selectors, causing
incorrect filtering when using kubectl with field selectors like
--field-selector=metadata.namespace=tenant-kvaps or metadata.name=test.

Changes:
- Created pkg/registry/fields package with ParseFieldSelector utility
- Refactored field selector parsing logic in application, tenantmodule,
  and tenantsecret registries to use common implementation
- Implemented manual filtering for metadata.name and metadata.namespace
  in List() and Watch() methods
- Removed Raw field usage and field selectors from client.ListOptions
- Label selectors passed directly via LabelSelector field

Field selectors now properly filter resources by name and namespace
through manual post-processing after label-based filtering.

See: https://github.com/kubernetes-sigs/controller-runtime/issues/612

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-01-10 01:44:20 +01:00
..
apis Fix review comments 2025-12-19 10:13:36 +01:00
apiserver [api] Fix representation of dynamic list kinds 2025-11-13 18:04:33 +03:00
cmd/server Update go modules 2025-12-23 19:45:47 +01:00
config Scaffold CozyRD CRD 2025-07-29 17:03:22 +03:00
generated [dashboard] sync with upstream & enhancements 2025-11-05 18:22:22 +01:00
lineage [controller,api] Specify visible secrets 2025-10-01 16:56:52 +03:00
ovnstatus [kubeovn] Implement the KubeOVN plunger 2025-09-11 02:11:58 +03:00
registry fix(registry): implement field selector filtering for label-based resources 2026-01-10 01:44:20 +01:00