-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
--refresh-crds is handled in batch and interactive modes, but ignored in daemon mode.
Affected code
- Batch refresh handling:
src/main.rs(run_batch) - Interactive refresh handling:
src/main.rs(run_interactive) - Daemon startup path without refresh:
src/main.rs+src/daemon/pgwire_server.rs
Problem
Starting daemon with --refresh-crds does not clear CRD schema cache before session initialization.
This is inconsistent with other modes and can leave daemon sessions running on stale CRD schemas.
Why this matters
- Daemon is long-lived, so stale schema effects can persist for a long time.
- Same flag has different semantics depending on mode.
- Users may expect
k8sql --refresh-crds daemonto force fresh schema discovery but it currently doesn't.
Proposed fix
- Centralize refresh logic in one helper (e.g.
maybe_refresh_crd_cache(bool)). - Invoke it before startup in all modes:
- batch
- interactive
- daemon
- Keep failures non-fatal (current behavior), but emit warning consistently.
Tests to add
- Integration/behavioral test that daemon path triggers refresh when flag is set.
- Regression test ensuring mode parity for
--refresh-crdsbehavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels