Show kubeconfig in prompt

This commit is contained in:
2023-02-17 09:50:47 +01:00
parent a9c33ba704
commit bcc4ffa91a
2 changed files with 30 additions and 3 deletions
+19
View File
@@ -94,6 +94,25 @@ if [ $? -eq 0 ]; then
alias dcd="docker-compose down"
fi
command -v kubectl > /dev/null 2>&1
if [ $? -eq 0 ]; then
# Sets the kube config
kube() {
local kube_config=$HOME/.kubes/$1/config
if [ $# -ne 1 ]; then
echo >&2 error: kube expects a single argument
return 1
elif [ ! -f $kube_config ]; then
echo >&2 error: no such kube config: $kube_config
return 1
else
export KUBECONFIG=$kube_config
fi
}
fi
# change to git directory
cdg() {
local newdir