fix(kube): correct kubectl context, dialog close, icon visibility, cluster name #80

Merged
sarman merged 2 commits from fix/kube-cluster-connection into master 2026-06-08 00:16:25 +00:00
Owner

Summary

  • kubectl credentials errorKUBERNETES_CONTEXT is not a real kubectl environment variable. All 41 invocations across kube.rs silently ignored it and fell back to whatever current-context was set in the kubeconfig YAML, which could have stale/invalid credentials. Replaced every instance with --context <name> as a proper CLI argument.
  • GUID still showing in cluster name — Two independent causes: (a) Hotbar read from kubernetesStore.clusters which is never populated by the kubeconfig-based flow, so selectedCluster was always undefined. Removed that lookup, added a clusterName prop populated from selectedConfig?.name. (b) ClusterOverview fell back to the raw UUID when clusterName was briefly undefined during load — changed to conditional rendering so the UUID never appears.
  • Bell dialog had no close control — Custom DialogContent had no X button and no backdrop-click handler. Added both.
  • Hotbar icons invisible in dark modevariant="ghost" provides hover-only styling with no baseline text color. Added className="text-foreground" to all three icon buttons (Bell, Settings, User).

Test plan

  • Open Kubernetes section with active kubeconfig — resources load without credential error
  • Cluster name shows friendly upload name (e.g. devops1-mgmt), not UUID
  • Hotbar displays cluster name next to the search icon
  • Click bell icon → dialog opens; click X or backdrop → dialog closes
  • In dark mode — Bell, Settings, User icons are visible without hovering
  • npm run test:run — 268 pass
  • cargo test — 343 pass
  • cargo fmt --check, cargo clippy -- -D warnings, npx tsc --noEmit, npx eslint . --max-warnings 0 — all clean
## Summary - **kubectl credentials error** — `KUBERNETES_CONTEXT` is not a real kubectl environment variable. All 41 invocations across `kube.rs` silently ignored it and fell back to whatever `current-context` was set in the kubeconfig YAML, which could have stale/invalid credentials. Replaced every instance with `--context <name>` as a proper CLI argument. - **GUID still showing in cluster name** — Two independent causes: (a) `Hotbar` read from `kubernetesStore.clusters` which is never populated by the kubeconfig-based flow, so `selectedCluster` was always `undefined`. Removed that lookup, added a `clusterName` prop populated from `selectedConfig?.name`. (b) `ClusterOverview` fell back to the raw UUID when `clusterName` was briefly `undefined` during load — changed to conditional rendering so the UUID never appears. - **Bell dialog had no close control** — Custom `DialogContent` had no X button and no backdrop-click handler. Added both. - **Hotbar icons invisible in dark mode** — `variant="ghost"` provides hover-only styling with no baseline text color. Added `className="text-foreground"` to all three icon buttons (Bell, Settings, User). ## Test plan - [ ] Open Kubernetes section with active kubeconfig — resources load without credential error - [ ] Cluster name shows friendly upload name (e.g. `devops1-mgmt`), not UUID - [ ] Hotbar displays cluster name next to the search icon - [ ] Click bell icon → dialog opens; click X or backdrop → dialog closes - [ ] In dark mode — Bell, Settings, User icons are visible without hovering - [ ] `npm run test:run` — 268 pass - [ ] `cargo test` — 343 pass - [ ] `cargo fmt --check`, `cargo clippy -- -D warnings`, `npx tsc --noEmit`, `npx eslint . --max-warnings 0` — all clean
sarman added 1 commit 2026-06-08 00:00:05 +00:00
fix(kube): correct kubectl context, dialog close, icon visibility, cluster name
Some checks failed
Test / rust-tests (pull_request) Successful in 14m38s
PR Review Automation / review (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Successful in 1m50s
Test / frontend-typecheck (pull_request) Successful in 1m56s
Test / rust-fmt-check (pull_request) Successful in 11m10s
Test / rust-clippy (pull_request) Successful in 12m54s
fb55601e3b
1. kubectl credentials error (41 places in kube.rs)
   Every kubectl invocation used .env("KUBERNETES_CONTEXT", context) which
   is not a real kubectl environment variable — kubectl silently ignores it
   and falls back to whatever current-context is set in the kubeconfig YAML.
   If that context has expired or wrong credentials the auth failure occurs.
   Replaced all 41 instances with .arg("--context").arg(context) so kubectl
   always uses the correct context from the stored kubeconfig.

2. Cluster name still showed UUID (two causes)
   a) Hotbar read from kubernetesStore.clusters (ClusterInfo[]) which is never
      populated by the kubeconfig-based flow — always empty, so selectedCluster
      was always undefined. Removed the Zustand cluster lookup from Hotbar and
      added a clusterName prop passed from KubernetesPage.tsx (selectedConfig?.name).
   b) ClusterOverview fell back to showing raw clusterId UUID when clusterName
      was undefined. Changed subtitle to render conditionally so UUID never shows.

3. Bell dialog had no way to close
   Custom DialogContent had no X button and no backdrop-click handler.
   Added X close button (top-right) and backdrop-click-to-close.

4. Hotbar icons invisible in dark mode
   variant="ghost" only styles hover state with no baseline text color.
   Added className="text-foreground" to all icon-only ghost buttons.
sarman added 1 commit 2026-06-08 00:15:55 +00:00
Merge branch 'master' into fix/kube-cluster-connection
Some checks failed
PR Review Automation / review (pull_request) Has been cancelled
Test / rust-fmt-check (pull_request) Has been cancelled
Test / frontend-tests (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
Test / rust-clippy (pull_request) Has been cancelled
Test / frontend-typecheck (pull_request) Has been cancelled
8a51fbf269
sarman merged commit a9f213abe5 into master 2026-06-08 00:16:25 +00:00
sarman deleted branch fix/kube-cluster-connection 2026-06-08 00:16:25 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sarman/tftsr-devops_investigation#80
No description provided.