You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
m3-live-smoke.test.ts defaults to the stale kube context kind-kagenti #192
The default no longer matches what the setup scripts produce. On a current local bring-up the context is kind-sh-knative, so running the gated suite without setting KAGENTI_SANDBOX_CONTEXT targets a context that does not exist, and every kubectl call fails with a connection error rather than a clear "wrong context" message.
Why it matters
This suite is skip-by-default (M3_LIVE_SMOKE), so it is run rarely and usually by someone who did not write it. A stale default turns "I ran the live gate and it failed" into a misleading signal about the code under test rather than about the environment.
It matters slightly more right now because PR #188 adds a live assertion ("Claim 6") that was committed unrun, with a documented command for someone to run later. That command sets the variable explicitly — but anyone invoking the suite the obvious way will hit the stale default first.
Options
Drop the default and fail fast with a message naming the variable, e.g. KAGENTI_SANDBOX_CONTEXT must be set (current: $(kubectl config current-context)). Most honest — the suite cannot guess.
Default to the current context (kubectl config current-context) rather than a hardcoded name, so it follows whatever the operator has selected.
Update the literal to match today's setup scripts. Cheapest, and stale again after the next rename — which is how it got here.
Option 1 or 2 is preferable; the value is environment-specific and hardcoding any name reintroduces the problem.
Refs
Noticed while executing #188 (ST6); pre-existing and deliberately not changed there to keep that branch scoped.
kubectlExecRaw and buildKubectlArgs both append --context only when cfg.context is truthy, so undefined omits the flag and kubectl uses current-context by itself. That also makes the suite agree with three things it was already disagreeing with:
packages/k8s-sandbox/src/config.ts:25 and src/resolve-pod.ts:69, which already map an unset variable to undefined
harness/src/select-sandbox.ts:82, same
packages/k8s-sandbox/README.md, which already documented the default as current-context
So the literal was the odd one out repo-wide, not just stale — which is a point in favour of option 2 over option 1 that wasn't obvious from the issue.
No new test, deliberately. The changed line is inside describe.skipIf(!LIVE) gated on M3_LIVE_SMOKE, so nothing in CI can observe it — a test asserting on it would be asserting on a suite CI never runs. The behaviour it now matches is pinned, by packages/k8s-sandbox/test/config.test.ts.
SMOKE.md needed no change: its two kind-kagenti mentions record the cluster a past run used, and its invocation passes KAGENTI_SANDBOX_CONTEXT explicitly.
Activity
fix(k8s-sandbox): default the smoke suite's kube context to current-c…
Merge pull request #226 from pdettori/fix/issue-triage-first-session
pdettori commentedon Sep 6, 2026
Done in #226 (
1386a98), merged as1b5d4ef.Took option 2 (default to the current context), and it turned out to need no
kubectl config current-contextcall — just deleting the literal:kubectlExecRawandbuildKubectlArgsboth append--contextonly whencfg.contextis truthy, soundefinedomits the flag andkubectluses current-context by itself. That also makes the suite agree with three things it was already disagreeing with:packages/k8s-sandbox/src/config.ts:25andsrc/resolve-pod.ts:69, which already map an unset variable toundefinedharness/src/select-sandbox.ts:82, samepackages/k8s-sandbox/README.md, which already documented the default as current-contextSo the literal was the odd one out repo-wide, not just stale — which is a point in favour of option 2 over option 1 that wasn't obvious from the issue.
No new test, deliberately. The changed line is inside
describe.skipIf(!LIVE)gated onM3_LIVE_SMOKE, so nothing in CI can observe it — a test asserting on it would be asserting on a suite CI never runs. The behaviour it now matches is pinned, bypackages/k8s-sandbox/test/config.test.ts.SMOKE.mdneeded no change: its twokind-kagentimentions record the cluster a past run used, and its invocation passesKAGENTI_SANDBOX_CONTEXTexplicitly.