mirror of https://gitlab.com/dabruh/dotfiles.git
Use kubectl-ctx instead of self-built cx
This commit is contained in:
parent
7d2f08019a
commit
96c8473efe
|
@ -15,7 +15,7 @@ alias \
|
||||||
|
|
||||||
# Kubernetes things
|
# Kubernetes things
|
||||||
alias \
|
alias \
|
||||||
ctx="kubectl ctx" \
|
cx="kubectl ctx" \
|
||||||
f='flux' \
|
f='flux' \
|
||||||
h='helm' \
|
h='helm' \
|
||||||
k='kubectl' \
|
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 New Issue