Skip to content

Commit

Permalink
fix(kubectx): don't error on missing k8s context (ohmyzsh#10675)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamLR authored and kareefardi committed Feb 21, 2022
1 parent 322c1dc commit fdabf2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/kubectx/kubectx.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ typeset -g -A kubectx_mapping
function kubectx_prompt_info() {
(( $+commands[kubectl] )) || return

local current_ctx=$(kubectl config current-context)
local current_ctx=$(kubectl config current-context 2> /dev/null)

[[ -n "$current_ctx" ]] || return

# use value in associative array if it exists
# otherwise fall back to the context name
Expand Down

0 comments on commit fdabf2f

Please sign in to comment.