cozystack/pkg
Andrei Kvapil 3af7430074
fix(registry): implement field selector filtering for label-based resources (#1845)
## What this PR does

Fixes field selector filtering for registry resources (Applications,
TenantModules, TenantSecrets) when using kubectl with field selectors
like `--field-selector=metadata.namespace=tenant-kvaps` or
`metadata.name=test`.

Controller-runtime cache doesn't support field selectors natively, which
caused incorrect filtering behavior. This PR implements manual filtering
for `metadata.name` and `metadata.namespace` field selectors in List()
and Watch() methods.

Changes:
- Created `pkg/registry/fields` package with `ParseFieldSelector`
utility for common field selector parsing
- Refactored field selector logic in application, tenantmodule, and
tenantsecret registries to use the common implementation
- Implemented manual post-processing filtering after label-based queries
- Removed `Raw` field usage and field selectors from
`client.ListOptions`

### Release note

```release-note
[registry] Fix field selector filtering for kubectl queries with metadata.name and metadata.namespace selectors
```
2026-01-10 01:52:08 +01:00
..
apis [registry] Add application labels and update filtering mechanism (#1707) 2026-01-09 14:52:42 +01:00
apiserver [api] Fix representation of dynamic list kinds 2025-11-13 18:04:33 +03:00
cmd/server Update go modules (#1736) 2026-01-09 14:53:08 +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 (#1845) 2026-01-10 01:52:08 +01:00