Repository navigation
feat(kubernetes): kubeconfig:fetch -- one list over lokal/Vault/SOPS, filtered by lab - #14
Merged
Merged
Conversation
… SOPS) Without SOURCE, fetch lists every cluster once -- kubeconfigs already in ~/.kube plus Vault and SOPS entries -- with its sources next to it. Remote sources win and refresh the existing local file (unchanged files are left alone); local-only clusters just print the export. A failing source only drops its entries. SOURCE=lokal added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each cluster gets a lab: ~/.kube/labels (<cluster> <lab>), else the network of the local kubeconfig's server address (LAB_NETS, default 10.31.=labul 10.100.136.=labda), else Vault custom_metadata `lab`, else the name prefix (labda-/labul-), else `-`. fetch asks for the lab first (`alle` = everything, LAB=<lab> skips the question) and shows the lab as a column in the cluster list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
task -g kubeconfig:fetch(t kc) withoutSOURCEno longer asks for the source first. It asks for the lab, then shows one gum list over all sources:Sources
~/.kube(no*.bak*, must containclusters:)labda-sthings-infra.yamlstays.yaml), identical content →unveraendert, no writeexport KUBECONFIG=…Lab, first match wins:
~/.kube/labels(KUBE_LABELS), lines<cluster> <lab>server:(LAB_NETS, default10.31.=labul 10.100.136.=labda)custom_metadata.labonkubeconfigs/<cluster>labda-/labul--LAB=labulskips the lab question;alleshows everything.SOURCE=vault|sops|lokalandCLUSTER=still work non-interactively.Tested (stubbed gum): lab list, labul filter (11 clusters),
alle(27), labels-file override,LAB=without prompt, Vault fetch (homerun2-dev2, app-dev), SOPS fetch (labda-sthings-infra) byte-identical with the local copy, unchanged path, Vault outage, unknown cluster.🤖 Generated with Claude Code