Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
e13ff75f
Unverified
Commit
e13ff75f
authored
Aug 24, 2021
by
Mattias Öhrn
Committed by
GitHub
Aug 24, 2021
Browse files
fix(kubectx): show plain context if not mapped (#10134)
parent
6d5b8484
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/kubectx/kubectx.plugin.zsh
View file @
e13ff75f
...
@@ -3,12 +3,7 @@ typeset -A kubectx_mapping
...
@@ -3,12 +3,7 @@ typeset -A kubectx_mapping
function
kubectx_prompt_info
()
{
function
kubectx_prompt_info
()
{
if
[
$commands
[
kubectl]
]
;
then
if
[
$commands
[
kubectl]
]
;
then
local
current_ctx
=
`
kubectl config current-context
`
local
current_ctx
=
`
kubectl config current-context
`
# use value in associative array if it exists, otherwise fall back to the context name
#if associative array declared
echo
"
${
kubectx_mapping
[
$current_ctx
]
:-
$current_ctx
}
"
if
[[
-n
$kubectx_mapping
]]
;
then
echo
"
${
kubectx_mapping
[
$current_ctx
]
}
"
else
echo
$current_ctx
fi
fi
fi
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment