-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
refresh_tables / force discovery currently refreshes CRD inventory but not existing CRD schemas. Cached schemas for existing (group,version,kind) entries are reused, so schema changes can remain stale indefinitely.
Affected code
- Force path entry:
src/kubernetes/client.rs(refresh_tables,discover_resources_for_context) - Force CRD path:
src/kubernetes/client.rs(discover_all_crds) - Cache split:
check_crdsusage in force mode - Schema cache TTL:
src/kubernetes/cache.rs(SCHEMA_CACHE_TTL = None)
Root cause
In force mode, discover_all_crds still does:
check_crds(all_crds)- loads
cached_resources - rediscovers only
missing_crds
So existing CRDs are not re-parsed from live CRD definitions.
Why this matters
- CRD schema updates (new/changed custom fields) are not picked up by force refresh unless cache is manually cleared.
- This violates expected semantics of a force refresh and can cause stale table schemas.
Proposed fix
- In force mode, refresh schemas for all CRDs found in the cluster (not only missing ones).
- Overwrite cache entries with newly discovered schemas.
- Keep non-force path optimized with cache reuse.
Optional enhancement
- Consider finite
SCHEMA_CACHE_TTLfor normal mode, but force should still be unconditional schema refresh.
Tests to add
- Seed cache with schema A, simulate cluster schema B for same GVK, force refresh -> registry/cache should use B.
- Non-force path still uses cache when valid.
- Regression test for
refresh_tables()reflecting CRD field changes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels