mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-25 19:43:22 +00:00
Merge pull request #61129 from juanvallejo/jvallejo/fix-zsh-completion-debug
Automatic merge from submit-queue (batch tested with PRs 61129, 60359). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix kubectl_filedir completion Fixes https://github.com/kubernetes/kubernetes/issues/61017 **Release note**: ```release-note NONE ``` Issue was reproduced and verified fixed using steps from https://github.com/kubernetes/kubernetes/issues/61017#issuecomment-372650701 kubectl was checked outside of the above environment, to ensure it worked in local environment as well cc @seans3 @soltysh
This commit is contained in:
commit
1ba03c041b
@ -210,7 +210,7 @@ __kubeadm_get_comp_words_by_ref() {
|
|||||||
__kubeadm_filedir() {
|
__kubeadm_filedir() {
|
||||||
local RET OLD_IFS w qw
|
local RET OLD_IFS w qw
|
||||||
|
|
||||||
__debug "_filedir $@ cur=$cur"
|
__kubectl_debug "_filedir $@ cur=$cur"
|
||||||
if [[ "$1" = \~* ]]; then
|
if [[ "$1" = \~* ]]; then
|
||||||
# somehow does not work. Maybe, zsh does not call this at all
|
# somehow does not work. Maybe, zsh does not call this at all
|
||||||
eval echo "$1"
|
eval echo "$1"
|
||||||
@ -227,7 +227,7 @@ __kubeadm_filedir() {
|
|||||||
fi
|
fi
|
||||||
IFS="$OLD_IFS"
|
IFS="$OLD_IFS"
|
||||||
|
|
||||||
IFS="," __debug "RET=${RET[@]} len=${#RET[@]}"
|
IFS="," __kubectl_debug "RET=${RET[@]} len=${#RET[@]}"
|
||||||
|
|
||||||
for w in ${RET[@]}; do
|
for w in ${RET[@]}; do
|
||||||
if [[ ! "${w}" = "${cur}"* ]]; then
|
if [[ ! "${w}" = "${cur}"* ]]; then
|
||||||
|
@ -141,7 +141,7 @@ __kubectl_get_containers()
|
|||||||
{
|
{
|
||||||
local template
|
local template
|
||||||
template="{{ range .spec.containers }}{{ .name }} {{ end }}"
|
template="{{ range .spec.containers }}{{ .name }} {{ end }}"
|
||||||
__debug "${FUNCNAME} nouns are ${nouns[*]}"
|
__kubectl_debug "${FUNCNAME} nouns are ${nouns[*]}"
|
||||||
|
|
||||||
local len="${#nouns[@]}"
|
local len="${#nouns[@]}"
|
||||||
if [[ ${len} -ne 1 ]]; then
|
if [[ ${len} -ne 1 ]]; then
|
||||||
|
@ -223,7 +223,7 @@ __kubectl_get_comp_words_by_ref() {
|
|||||||
__kubectl_filedir() {
|
__kubectl_filedir() {
|
||||||
local RET OLD_IFS w qw
|
local RET OLD_IFS w qw
|
||||||
|
|
||||||
__debug "_filedir $@ cur=$cur"
|
__kubectl_debug "_filedir $@ cur=$cur"
|
||||||
if [[ "$1" = \~* ]]; then
|
if [[ "$1" = \~* ]]; then
|
||||||
# somehow does not work. Maybe, zsh does not call this at all
|
# somehow does not work. Maybe, zsh does not call this at all
|
||||||
eval echo "$1"
|
eval echo "$1"
|
||||||
@ -240,7 +240,7 @@ __kubectl_filedir() {
|
|||||||
fi
|
fi
|
||||||
IFS="$OLD_IFS"
|
IFS="$OLD_IFS"
|
||||||
|
|
||||||
IFS="," __debug "RET=${RET[@]} len=${#RET[@]}"
|
IFS="," __kubectl_debug "RET=${RET[@]} len=${#RET[@]}"
|
||||||
|
|
||||||
for w in ${RET[@]}; do
|
for w in ${RET[@]}; do
|
||||||
if [[ ! "${w}" = "${cur}"* ]]; then
|
if [[ ! "${w}" = "${cur}"* ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user