mirror of
https://gitlab.com/dabruh/dotfiles.git
synced 2024-12-25 19:44:17 +01:00
Use kubectl-ctx instead of self-built cx
This commit is contained in:
parent
7d2f08019a
commit
96c8473efe
2 changed files with 1 additions and 12 deletions
|
@ -15,7 +15,7 @@ alias \
|
|||
|
||||
# Kubernetes things
|
||||
alias \
|
||||
ctx="kubectl ctx" \
|
||||
cx="kubectl ctx" \
|
||||
f='flux' \
|
||||
h='helm' \
|
||||
k='kubectl' \
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# cx - Kubernetes context switcher
|
||||
|
||||
LAST=/tmp/last_kube_context
|
||||
CURR="$(kubectl config current-context)"
|
||||
[[ -z "$1" ]] && kubectl config get-contexts && exit
|
||||
[ ! -f $LAST ] && echo "$CURR" >$LAST
|
||||
[[ "$1" == "-" ]] && USE="$(cat $LAST)" || USE="$1"
|
||||
[[ "$CURR" != "$USE" ]] && echo "$CURR" >$LAST
|
||||
kubectl config use-context "$USE"
|
Loading…
Reference in a new issue