diff --git a/lib/kubernetes.sh b/lib/kubernetes.sh index 7d91c26b2f4..e24d59a6e92 100644 --- a/lib/kubernetes.sh +++ b/lib/kubernetes.sh @@ -56,7 +56,8 @@ kube_current_context(){ kube_current_namespace(){ kubectl config get-contexts | - awk "/$(kube_current_context)/ {print \$NF}" + { grep -F "$(kube_current_context)" || die "Failed to get current context"; } | + awk '{print $NF}' } kube_namespace(){