fix(kube): correct kubectl context, dialog close, icon visibility, cluster name #80
No reviewers
Labels
No Label
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sarman/tftsr-devops_investigation#80
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/kube-cluster-connection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
KUBERNETES_CONTEXTis not a real kubectl environment variable. All 41 invocations acrosskube.rssilently ignored it and fell back to whatevercurrent-contextwas set in the kubeconfig YAML, which could have stale/invalid credentials. Replaced every instance with--context <name>as a proper CLI argument.Hotbarread fromkubernetesStore.clusterswhich is never populated by the kubeconfig-based flow, soselectedClusterwas alwaysundefined. Removed that lookup, added aclusterNameprop populated fromselectedConfig?.name. (b)ClusterOverviewfell back to the raw UUID whenclusterNamewas brieflyundefinedduring load — changed to conditional rendering so the UUID never appears.DialogContenthad no X button and no backdrop-click handler. Added both.variant="ghost"provides hover-only styling with no baseline text color. AddedclassName="text-foreground"to all three icon buttons (Bell, Settings, User).Test plan
devops1-mgmt), not UUIDnpm run test:run— 268 passcargo test— 343 passcargo fmt --check,cargo clippy -- -D warnings,npx tsc --noEmit,npx eslint . --max-warnings 0— all clean1. 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.