Skip to content

Commit

Permalink
Improve kkp-cluster helper (#97)
Browse files Browse the repository at this point in the history
by setting a meaningful context in the temporary kubeconfig.

Signed-off-by: Hannes Probst <[email protected]>
  • Loading branch information
hc2p authored Jun 15, 2024
1 parent 87c7e9a commit a25bf63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fubectl.source
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ function kkp-cluster() {
TMP_KUBECONFIG=$(mktemp)
local cluster="$(kubectl get cluster | _inline_fzf | awk '{print $1}')"
kubectl get secret admin-kubeconfig -n cluster-$cluster -o go-template='{{ index .data "kubeconfig" | base64decode }}' > $TMP_KUBECONFIG
kubectl --kubeconfig $TMP_KUBECONFIG config rename-context default cluster-$cluster
KUBECONFIG=$TMP_KUBECONFIG $SHELL
}

Expand Down

0 comments on commit a25bf63

Please sign in to comment.