Origin: ZSH Completion not working: command not found: __kubectl_debug

Created on 21 Aug 2018  路  19Comments  路  Source: openshift/origin

zsh completion fails after trying to complete (i.e: press tab) on a file after a -f argument.

Version

oc v3.10.0+dd10d17
kubernetes v1.10.0+b81c8f8
features: Basic-Auth

Server https://192.168.64.37:8443
openshift v3.10.0+a5e4ac9-10
kubernetes v1.10.0+b81c8f8

Steps To Reproduce
  1. zsh -i
  2. source <(oc completion zsh)
  3. oc create -f TAB
Current Result

__kubectl_filedir:20: command not found: __kubectl_debug

Expected Result

Completion after -f on files

Additional information

zsh 5.5.1 (x86_64-apple-darwin17.5.0)

lifecyclrotten simaster

Most helpful comment

I guess as a workaround you can just do a :

% source <(kubectl completion zsh)

just before doing the source of oc completion zsh to get it to work.

whoever that needs it, that's the solution,

All 19 comments

@openshift/sig-master

Seems to be related to https://github.com/kubernetes/kubernetes/commit/3dc952e76108ca45d2311bb4ef7934be794ee5a1

I cannot find the definition of __kubectl_debug in the source.

/assign @juanvallejo

@sttts i think cobra is generating those functions, probably related
https://github.com/kubernetes/kubernetes/issues/61017#issuecomment-372656711

We have:

__oc_debug()
{
    if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
    fi
}

Seeing a carry patch in the near future :)

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

I have the same problem.

Also source <(oc completion zsh) returns 127

oc v3.10.0+dd10d17
kubernetes v1.10.0+b81c8f8
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://10.100.2.228:8443
openshift v3.10.0+8a70964-87
kubernetes v1.10.0+b81c8f8

zsh 5.4.2 (x86_64-ubuntu-linux-gnu)

Does running oc completion zsh works for you? I tried it and it runs fine.

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

This is still hapenning fyi,

/remove-lifecycle stale

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

What is the solution to this issue? It still persists.

I still have the issue as of today :

 % oc version
Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.0+7599337-146", GitCommit:"7599337aee", GitTreeState:"clean", BuildDate:"2019-05-15T09:23:59Z", GoVersion:"go1.12.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.4+8cd4e29", GitCommit:"8cd4e29", GitTreeState:"clean", BuildDate:"2019-05-09T19:20:33Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

 % source <(oc completion zsh)
 % oc create -f [TAB] __kubectl_filedir:3: command not found: __kubectl_debug
__kubectl_filedir:20: command not found: __kubectl_debug       

I guess as a workaround you can just do a :

% source <(kubectl completion zsh)

just before doing the source of oc completion zsh to get it to work.

whoever that needs it, that's the solution,

Wow... For so long I have been iritated by this bug and the solution is THAT simple! Thanks @chmouel!!!

@chmouel you are my hero!!! It's still shame that nobody from dev team actually look into this for so long, but anyway, thanks for this tip!!

Alternatively, add kubectl to the list of plugins in your ~/.zshrc

@lxop I believe you are speaking in the context where you run your configuration under a ready made configuration framework like oh-my-zsh, prezto or others which is not the case for everyone (or at least I don't)

Was this page helpful?
0 / 5 - 0 ratings