makes the kube tool slightly better when using tmux
Copies the work done on the vault tool into the kube tool.
When not using tmux, the UX is the same with slight improvement:
% TMUX='' glsh kube use-cluster gstg
Switched to context "gke_gitlab-staging-1_us-east1_gstg-gitlab-gke".
Spinning up a tunnel, this will NOT drop you into a shell prompt, open a new terminal after connection is made...
Connected! Press Enter to disconnect.
Tunnel is now closed, switching to empty context...
Switched to context "empty".
When using tmux, it'll spin up a new small pane that includes the details of the tunnel, just like that of vault:
In the initiating pane:
% glsh kube use-cluster gstg
Switched to context "gke_gitlab-staging-1_us-east1_gstg-gitlab-gke".
In the pane that opened:
[kube] Starting SOCKS5 proxy on port 1085 through console-01-sv-gstg.c.gitlab-staging-1.internal...
Connected! Press Enter to disconnect.
The downside to this is that I can't figure out how to ask the shutdown of the tunnel to auto switch the context back to empty like we currently do if you leverage the old method. I'm unsure how to solve this. This was a safety to help prevent accidents by forcibly changing the context when the tunnel is closed.