Skip to content

m3-live-smoke.test.ts defaults to the stale kube context kind-kagenti #192

Description

@pdettori

Problem

packages/k8s-sandbox/test/m3-live-smoke.test.ts:27:

context: process.env.KAGENTI_SANDBOX_CONTEXT ?? "kind-kagenti",

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

  1. 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.
  2. Default to the current context (kubectl config current-context) rather than a hardcoded name, so it follows whatever the operator has selected.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions