From 1e10ad18139152172fa6829153a90a4d833d610b Mon Sep 17 00:00:00 2001 From: Szymon Szypulski Date: Wed, 22 May 2019 06:54:11 +0200 Subject: [PATCH] Ignore unset and empty Kubernetes context When current-context does not exist or is unset in $KUBECONFIG, kubectl is throwing a message to stderr "error: current-context is not set". Ignore it. --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 2761b632..e9e862e1 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -337,7 +337,7 @@ function ruby_version_prompt { } function k8s_context_prompt { - echo -e "$(kubectl config current-context)" + echo -e "$(kubectl config current-context 2> /dev/null)" } function virtualenv_prompt {