Skip to content

Commit e449e73

Browse files
authored
Wrap context names in single quotes to prevent completion script to fail (#316)
1 parent 3321206 commit e449e73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

completion/kubectx.zsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
local KUBECTX="${HOME}/.kube/kubectx"
44
PREV=""
55

6-
local all_contexts="$(kubectl config get-contexts --output='name')"
6+
local context_array=("${(@f)$(kubectl config get-contexts --output='name')}")
7+
local all_contexts=(\'${^context_array}\')
8+
79
if [ -f "$KUBECTX" ]; then
810
# show '-' only if there's a saved previous context
911
local PREV=$(cat "${KUBECTX}")

0 commit comments

Comments
 (0)