Skip to content

fix(installer): point kubeconfig at the client namespace after deploy - #208

Merged
saadqbal merged 1 commit into
developfrom
fix/kubeconfig-namespace-after-install
Jun 5, 2026
Merged

fix(installer): point kubeconfig at the client namespace after deploy#208
saadqbal merged 1 commit into
developfrom
fix/kubeconfig-namespace-after-install

Conversation

@LukasWodka

Copy link
Copy Markdown
Contributor

Bug

Right after a successful install, the first CLI command errors:

$ tracebloc cluster info
Error: no tracebloc parent client release found in namespace "default" ...

The installer deploys the client into the tracebloc namespace, but the k3d kubeconfig context stays on default — so the CLI (and plain kubectl) look in the wrong namespace. The documented next step, tracebloc dataset push ./data, hits the same error.

Fix

After helm upgrade --install, set the current context's namespace to $TB_NAMESPACE (best-effort, honors TB_NAMESPACE overrides). Now kubectl and the tracebloc CLI default to the client's namespace — no -n / --namespace needed. Mirrored in install-k8s.ps1; new bats test asserts the set-context call.

Follow-up (separate PR, cli repo)

Make the CLI auto-discover the client's namespace (scan for *-jobs-manager) so it's robust when the context isn't set or the client lives in a custom namespace.


Targets develop. Local bats: the new test passes; the one unrelated failure (_extract_yaml_value single-quote) is the known macOS bash-3.2 quirk that also fails on pristine develop — CI (bash 5) passes it. PowerShell mirror per the usual Windows-reviewer check.

After `helm upgrade --install` into the fixed `tracebloc` namespace, set the
current kubeconfig context's namespace to it — so `kubectl` and the tracebloc
CLI (`cluster info` / `dataset push`) default to the right namespace with no
-n / --namespace flag.
Without this the context stayed on `default`, so the first post-install CLI
command errored: "no tracebloc parent client release found in namespace
default". The documented next step (`tracebloc dataset push ./data`) hit it too.
- Best-effort (`|| true`) so it never aborts an otherwise-successful install.
- Honors TB_NAMESPACE overrides (uses the var, not a hardcoded name).
- Mirrored in install-k8s.ps1.
- New bats test asserts the set-context call with the namespace.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

👋 Heads-up — Code review queue is at 18 / 8

Above the WIP limit. The team convention is to review existing PRs before opening new work.

Open PRs currently in Code review (oldest first):

Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.)

@saadqbal
saadqbal merged commit 5f42156 into developJun 5, 2026
22 checks passed
@LukasWodkaLukasWodka added bug Something isn't working work-type:bug Defect or regression labels Jun 8, 2026
@saadqbal
saadqbal deleted the fix/kubeconfig-namespace-after-install branch July 9, 2026 11:41
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingwork-type:bugDefect or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@LukasWodka@saadqbal