fix(kube): use current-context for kubectl auth; fix SelectValue label display #81
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#81
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/kube-select-label-and-context"
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?
Problems
1. kubectl credentials still failing
Both
extract_context()(kube.rs) andupload_kubeconfig()(shell.rs) ignored the kubeconfig'scurrent-contextfield and always pickedcontexts[0]from the contexts array. If a kubeconfig has multiple contexts andcurrent-contextpoints to entry N>0, the wrong context was silently used — one that may have empty or expired credentials — causing the 401 "the server has asked for the client to provide credentials" error.Fixes:
extract_context()— readscurrent-contextfield first; falls back tocontexts[0]only when absent or emptyextract_current_context_name()— new helper inkubeconfig.rsusing the same line-scanner approachupload_kubeconfig()— usescurrent-contextto select the matching context when storing to DB2. Cluster dropdown still showing UUID
SelectValuerenderedctx.value(the raw UUID) instead of the display label (SelectItemchildren). The custom Select component had no mechanism to mirror a selected item's children into the trigger.Fix:
Selectnow builds avalue → labelMap by walking the children tree viacollectLabels(). The map is memoised onchildren.SelectValuereads the display label from the map and falls back to the raw value if not found.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 clean