ability to expose kubeswitch context
Hello,
First of all thanks for this lovely project. It's a life changer for me.
But I'd love to make it even more lovely for my personal needs and for that I need ability to somehow rename k8s context based on information from kubeswitch and its context.
switch list-contexts shows something like this:
us-ord-alpha/lke236266-ctx
us-ord-beta/lke236267-ctx
These us-ord-xxx are let's say userfriendly names of my clusters while lkeXXXXX is actual context name listed in kubeconfig. So relevant part of kubeconfig looks like this:
current-context: lke236266-ctx
kubeswitch-context: us-ord-alpha/lke236266-ctx
I'd like to get "us-ord-alpha" into my shell prompt somehow but that information is not exposed so currently if I switch to "us-ord-alpha" I'm getting the following in my prompt:
[☸ lke236266:default] ❯ ~
I'm looking for a way to replace that real context name with us-ord-alpha in this case. Any hints how to do that?
As a workaround I'm using context instead of cluster name in my prompt and the following snippet:
kubectl config rename-context $(kubectl config current-context) $(grep kubeswitch $KUBECONFIG | awk -F/ '{ print $1 }' | awk '{ print $2 }')
So I'm kinda all but leaving ticket open as exposing such info might be useful for other purposes.