Add kubectl shell context to prompt
This commit is contained in:
parent
9385925ad9
commit
19a52e0621
1 changed files with 5 additions and 1 deletions
4
.zshrc
4
.zshrc
|
|
@ -172,7 +172,11 @@ terraform_wrapper() {
|
|||
}
|
||||
kubectl_wrapper() {
|
||||
if type -p kubectl > /dev/null ; then
|
||||
if [ -z "$KUBE_CONTEXT" ]; then
|
||||
local k8s_context=$(kubectl config current-context 2> /dev/null)
|
||||
else
|
||||
local k8s_context="$KUBE_CONTEXT"
|
||||
fi
|
||||
if [ -z "$k8s_context" ]; then
|
||||
return
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue