Repository navigation
feat(loaderkit): the cluster resolver carries the kubeconfig file beside the context - #376
Conversation
…ide the context A `cluster: <profile>` resolved to ONE string — the context name. A cluster template addresses a per-cluster kubeconfig FILE (opencharly/spec#221), and that name cannot select it, so every consumer of this helper was structurally unable to honour the file the template declared. `ResolveClusterViaExecutor` now returns the resolved template itself — the kubeconfig file, the context inside it, and the opaque cluster model — and `ResolveClusterContextViaExecutor` stays the thin wrapper over it, so every existing caller keeps its exact contract: one implementation, two views (R2), with the existing arms' tests unchanged as the witness. Miss and failure semantics are preserved bit for bit: (nil, nil) for a legitimate miss, a loud error naming the cluster otherwise — the asymmetry opencharly/plugin-kube#15 depends on, which the new tests pin from the full view's side too. Pins: spec v0.2026287.638 (opencharly/spec#221, merged and tagged). Closes #375 Agent: dsh-k8s-ext Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: SDK / plugin-library Go module (Go library change + Policy-B spec pin bump). Security screen: no T1–T4 finding (no secrets, no egress, no guardrail/validator/rulebook edit, no supply-chain change beyond the declared pin). Blocks
Non-blocking note (R7, no action required to merge): the new tests exercise only the unexported Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…eviewed revision Round-1 fix. The validator's finding was fair: the "How tested" block was headed with the BASE SHA (`2f4014b`, captured before the commit, by construction), while the PR head was `f018de0`, so the pasted gate could not be attributed to the changed tree — and the same SHA appeared in the R6 line as `origin/main`, which read as a contradiction. Root fix in the control, not just the prose: the gate is now run on the COMMITTED tree and pasted with that head SHA, so the ordering is commit -> gate -> paste -> push. Two SHAs named in one body are now labelled by role (base vs head). Also closes the validator's non-blocking R7 note: the new tests exercised only the unexported seam, so `ResolveClusterViaExecutor` itself had no call in the diff. The exported resolver is now called directly and its nil-executor arm pinned. Agent: dsh-k8s-ext Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
|
RCA — round 0 BLOCK (R10/A1: the pasted gate evidence was not tied to the PR head) Mechanism. The "How tested" block was generated by a script whose header line was Missed control. My pre-push self-audit checked "did the gate pass?" but not "was the gate run Blast radius. Every PR whose evidence block is captured pre-commit carries the same defect, not Root fix (in the control, not the prose). The gate is now executed on the COMMITTED tree with Also closed, per the same verdict's non-blocking note: the exported Agent: dsh-k8s-ext |
Review — PASSHead SHA: Security screen: PASS — no T1–T4 finding (no secrets/egress/eval, no guardrail/validator/rulebook edit; the sole supply-chain change is the declared Policy-B spec pin, matching go.mod/go.sum). Comment dispositions:
Tool-limited dispositions (cannot re-run): the pasted module gate is internally consistent with the diff — the six test names, module paths, and Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…file, the shared resolver, and the caller's deadline (#25) * feat(kubernetes): honour the cluster template's kubeconfig file, and delegate the resolution `#Kubernetes` and `#KubernetesDeployVenue` carry a kubeconfig FILE (opencharly/spec#221, #224), and `loaderkit.ResolveClusterViaExecutor` hands it out (opencharly/sdk#376). This plugin could use neither: the `kube:` verb read the context-only view, the preresolver built a context-only venue, and `kubectlContextArgs` therefore emitted only `--context`. "Point charly at a kubeconfig and deploy onto the cluster in it" stopped one hop short of working for the workload substrate — while the KubeVirt CR path already honoured the file, which is what made the asymmetry visible on a real external cluster. * the verb's cluster resolution is now `loaderkit.ResolveClusterViaExecutor`, and `applyResolvedCluster` merges BOTH halves into the step's connection inputs (an authored `kubeconfig:` still wins; a legitimate miss still leaves the caller's fallback alone); * `preresolve.go` fills the venue's `kubeconfig` from the template; * ONE argv builder — `kubectlClusterArgs` / `kubectlClusterPrefix` — emits `--kubeconfig` beside `--context`, each half omitted when unset, for the apply, the recorded teardown and both cluster substrates (a kindcluster passes no file: its context is kind's own locally generated kubeconfig). R2/R5: the local `resolveKubeVerbCluster` copy is DELETED, not taught the new field — it was the second occurrence the sdk hoisted in opencharly/sdk#338, and its arms' tests moved to the sdk with it; what stays here is the wiring, now covered by `TestApplyResolvedCluster` / `TestKubectlClusterArgs` / `TestKubectlClusterPrefix`. The `plugin-kube:` candy prose that described the context-only resolution is corrected in the same commit. The five pre-existing `errcheck` findings in `kindcluster.go` and its test are fixed here rather than filed: `golangci-lint run ./...` now reports 0 issues module-wide. Pins: `spec v0.2026287.716` (the tag carrying #224), `sdk v0.2026287.726` (#376). NOT spec v0.2026287.727: that tag carries #225, whose removal `sdk v0.2026287.726` still re-exports in `vmshared/spec_aliases.go` — measured here, and exactly the scheduled break opencharly/sdk#377 tracks. This plugin takes the removal on its own pin wave, after that. Closes #23 Agent: dsh-k8s-ext Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * fix(kube): the verb honours its caller's deadline, so a hung dial fails fast and names its phase The kube op runs inside the host's RPC call and receives that call's context, but 20 client call sites passed context.TODO() — an uncancellable, deadline-free context. A hung dial therefore outlived the host's deadline, kept the plugin blocked on a call nothing could cancel, and surfaced only as `verb "kube": rpc error: code = DeadlineExceeded` with no phase named. Measured on a bed probe (#24). dispatch now bounds the WHOLE op by the step's own timeout — one canonical defaultOpTimeout, replacing four scattered parseTimeout(op.Timeout, ...) calls — nested inside the caller's deadline, whichever is shorter, and threads it into all 13 methods and the addons helper. The client is injectable, and a test asserts the context the verb hands its client carries a deadline bounded by the step's timeout and by a tighter caller deadline alike; it FAILS against context.TODO(). Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * fix(kube): every deadline routes through one helper, so the claim matches the diff The review found the body describing an intent the diff did not implement: it said the scattered parseTimeout calls had been replaced, but only the 120s ones actually had been. This makes that true rather than softening the sentence — opTimeout(method, op) is now THE deadline of a kube op, with the per-method defaults in a single methodTimeouts table (wait-* 120s, addons 180s, lb-external-ip 60s, exactly as the in-tree Kong tags document), and every one of the four waiting methods calls it. `grep -c 'parseTimeout(' methods.go` is 0, and the only call left in the package is inside the helper. Also settles the go.sum discrepancy the same review flagged: `go list -m` selects spec v0.2026287.716, nothing in the module graph requires v0.2026287.727, so that checksum was a stale entry and `go mod tidy` prunes it here rather than leaving a version named nowhere. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) --------- Co-authored-by: Andreas Trawoeger <[email protected]>
Summary
A
cluster: <profile>resolved to ONE string — the kubeconfig context name. A cluster templateaddresses a per-cluster kubeconfig FILE (
#ResolvedKubernetes.kubeconfig, opencharly/spec#221,tagged
v0.2026287.638), and a context name cannot select that file, so every consumer of thishelper was structurally unable to honour what the template declared. On an externally-managed
cluster that is exactly the case that matters: the ambient
$KUBECONFIG/~/.kube/confignamessome other cluster.
ResolveClusterViaExecutornow returns the resolved kind:kubernetes template itself — thekubeconfig file, the context inside it, and the opaque cluster model — and
ResolveClusterContextViaExecutorstays the thin wrapper over it, so every existing caller keepsits exact contract. One implementation, two views (R2).
Miss and failure semantics are preserved bit for bit:
(nil, nil)for a legitimate miss (theproject declares no such entity), and a loud error naming the cluster otherwise — the asymmetry
opencharly/plugin-kube#15depends on (a resolve FAILURE must never be read as "no clusterprofile"). The existing arms' tests are unchanged and still pass; the new tests pin the same
asymmetry from the full view's side, plus the file riding through beside the context and both
views agreeing, so no caller can behave differently based on which it was written against.
Pins:
specv0.2026280.2244 → v0.2026287.638 (a merged, tagged ref — Policy B).Round 1 (head
8079e14) answers the validator's round-0 verdict, which was fair:2f4014b— captured before the commit,by construction — so it could not be attributed to the changed tree, and the same SHA also
appeared in the R6 line as
origin/main, which read as a contradiction. The root fix is in thecontrol: the gate is now run on the COMMITTED tree (commit → gate → paste → push) and pasted
with that head SHA, and the two SHAs are labelled by role below.
ResolveClusterViaExecutorhad no directcall in the diff, so it is now called directly and its nil-executor arm pinned
(
TestResolveClusterViaExecutorIsTheExportedContract).Closes #375
How tested
Change class: SDK / plugin-library Go module. The repo's own committed module CI is the gate
(
/charly-check:check"R10 gate by change class") — there is no per-repo candy gate, and this isa mechanism library, not a runtime path.
Base (branched off fresh
origin/main):2f4014b7. PR head this run was made on:8079e14c.The changed path executes live inside those tests: every arm of the resolver — nil executor,
failing project-dir seam, failing entity resolve, resolved-with-a-file, resolved-and-empty,
nil-view miss — runs against the real
sdk.NewInProcExecutorreverse-channel double, the twoviews are compared against the same seam, and the exported resolver is called directly.
Rulebook compliance
/charly-internals:plugin,/charly-internals:go,/charly-internals:install-plan,/charly-internals:git-workflow,/charly-internals:strict-policy,/charly-internals:root-cause-analyzer.let it slip is repaired, not just the text), and the RCA with the named missed control is in the
round's PR comment. The non-blocking R7 note is also closed. No new anomaly: the module gate on
this head is green with zero warnings, pasted above.
resolveCluster; no second resolver, no copy in a plugin.error wraps the cause with
%w.it. The two plugin copies this helper replaced stay tracked at
opencharly/plugin-kube#15.behaviour, so no consumer sweep is owed. Its docstring is rewritten to say it is now the
context-only VIEW, not the only resolution.
git statusclean before the branch and before this round's commit; branched off freshorigin/main(2f4014b7) in a session worktree; the round's fix is an APPENDED commit, never anamend, and there is no force-push or bypass.
ResolveClusterViaExecutordoes not exist beforeit, the exported resolver is now called directly by a test, and the file-carrying assertions
cannot pass against a context-only return.
which the in-process double exercises for real. The live bed belongs to the consumer PR.
8079e14c, on the exact tree pushed,with a clean working tree, zero warnings, pasted above.
context, and the wrapper keeps the old contract, so no caller is left in a limbo state.
the pasted proof, which now names the head SHA it was produced on.
Change classification
opencharly/sdk) + a Policy-B pin bump.fully tested and validated- the module's gate passed on this exact head and ispasted.
opencharly/plugin-kube(thekube:verb's cluster resolution; then the deployapply, which needs
#KubernetesDeployVenue.kubeconfig— landed in feat(schema): the deploy venue carries the kubeconfig file (kubernetes substrate) spec#224) andopencharly/plugin-kubevirt.Filed issues
None - the change surfaces no separable finding. The two plugin-local copies of this mechanism it
supersedes are already filed at
opencharly/plugin-kube#15by the round that hoisted it here, andthe consumer adoption is the next PR in the producer-first chain, not a finding.
Agent: dsh-k8s-ext
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)