fix(kube): bridge kubeconfig storage to in-memory cluster map and fix UI issues #79
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#79
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
state.clusters(in-memory map) which was never populated from thekubeconfig_filesDB table. Addedconnect_cluster_from_kubeconfigTauri command that decrypts and loads the stored kubeconfig intostate.clusters. Called on page load and on cluster change.is_activeflag but never hydrated the in-memory client map.ClusterOverviewdisplayed the raw UUID as the subtitle. Now accepts aclusterNameprop (passed fromkubeconfig.context) and renders it instead.ClusterDetailssimilarly changed to showkubeconfig.contextin the header.Hotbarbell button had noonClickhandler. Added optionalonNotifications/notificationCountprops. Badge count is now dynamic rather than hardcoded.KubernetesPagewires up a notifications dialog showing active cluster context.Test plan
devops1-mgmt), not UUIDnpm run test:run— 262 tests passcargo test— 331 tests passAutomated PR Review (qwen36-35b-a3b-nvfp4 via liteLLM):\n\nSummary
The PR introduces a
connect_cluster_from_kubeconfigcommand to bridge encrypted kubeconfig storage with an in-memory cluster map. A critical logic error inKubernetesPage.tsxcauses the application to attempt to connect every stored kubeconfig on startup, potentially causing unnecessary API calls, errors, or state pollution for all users. Additionally, theclassifier.rsrefactor removes comments explaining the safety rationale for Tier 3 commands, increasing the risk of future regression.Findings
[WARNING] src/pages/Kubernetes/KubernetesPage.tsx:262 - Startup logic iterates over ALL kubeconfigs to connect them, rather than just the active one. This is likely unintended behavior causing "failed to load" noise for inactive clusters and potential race conditions.
Evidence:
const activeConfig = kubeconfigsData.find((c) => c.is_active);is retrieved but ignored. The subsequent loopfor (const config of kubeconfigsData) { await connectClusterFromKubeconfigCmd(config.id).catch(() => {}); }connects everything.Fix: Replace the loop with a check for
activeConfigand only connect that specific ID.[SUGGESTION] src-tauri/src/shell/classifier.rs - Removal of inline comments explaining why specific commands (e.g.,
kill,init) are Tier 3 reduces code maintainability and makes it easier for future developers to accidentally revert the "Bug fix" safety hardening.Evidence: The diff removes lines like
// Linux — process / system control (all destructive without subcommand context)and replaces them with minimal data structures.Fix: Add brief comments to the constant arrays explaining the classification rationale (e.g., "Destructive: kills processes, no recovery").
Verdict: APPROVE WITH COMMENTS