-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
User Story
As a developer using ksail workload watch on a large Kubernetes repo,
I want the watch command to reconcile only the Kustomization subtree affected by my file changes,
So that reconcile latency is minimised and I get faster feedback without waiting for unrelated Kustomizations to re-run.
Context
The Weekly Roadmap — March 16, 2026 identifies selective Kustomization reconcile as the third highest unshipped "Now" priority:
In repos with 10+ Kustomizations, full-tree reconcile latency is the dominant UX pain point. Selective reconcile significantly reduces iteration latency and converts
workload watchfrom a convenience into a genuinely fast inner-loop tool. No new dependencies required.
ksail workload watch currently triggers a full reconcile of k8s/ (or spec.workload.sourceDirectory) on any file change. In large repos with multiple Kustomization overlays (e.g., k8s/clusters/, k8s/apps/, k8s/infra/), this causes unnecessary reconcile cycles for all unrelated Kustomizations.
Approach
- Map changed file → containing Kustomization — in the watch event handler, walk up the directory tree from the changed file path to find the nearest
kustomization.yamlboundary. - Resolve the Flux Kustomization CR — identify which Flux
KustomizationCR references the changed subtree by matchingspec.pathin the cluster's Kustomization objects. - Targeted reconcile — trigger
flux reconcile kustomization (name)only for the affected Kustomization(s) viapkg/client/flux/orpkg/client/reconciler/. - Full reconcile fallback — if the mapping is ambiguous, the changed file is at the root level, or the targeted CR cannot be determined, fall back to the existing full reconcile.
- Preserve existing debounce/coalescing — maintain the existing debounce and event coalescing behaviour.
Key files:
pkg/cli/cmd/workload/watch.go(or equivalent watch lifecycle path) — event handler to modifypkg/client/flux/— Flux reconcile clientpkg/client/reconciler/— common reconciler base- Watch infrastructure: wherever the file-change → reconcile trigger is wired
Acceptance Criteria
- Changing a file in a Kustomization subtree triggers reconcile of only that subtree's Kustomization CR
- Changing a top-level file (e.g., root
kustomization.yaml) triggers full reconcile as before - Ambiguous or unmappable changes fall back to full reconcile (no silent failures)
- Debounce and coalescing logic is preserved
- Unit tests cover the changed file → Kustomization mapping logic
-
go build ./...andgo test ./...pass - No regressions in existing
workload watchbehaviour
Generated by Daily Plan · ◷
Metadata
Metadata
Assignees
Labels
Type
Projects
Status