Open jmischler72 opened 1 month ago
Thanks or reporting this @jmischler72 Indeed there is an issue with completion. We're looking into it.
Can you tell what version you are using ?
Hello,
I’ve exactly same problem.
I’ve try with fresh zsh without any custom in zshrc just necessary for binenv (with completions) and kubectl (with completions). Fresh binenv installation and fresh kubectl command installation through binenv.
It’s seem to completion couldn’t be correctly loaded/called due to shims call for kubectl commands, but I’m not sure.
Version for me :
@jmischler72 @vfricou this should be fixed in v0.19.11.
Could you try to binenv update && binenv install binenv
please ?
If you still have issues with the new version, please do the following:
export BASH_COMP_DEBUG_FILE=/tmp/binenvdebug
kubectl g<TAB><TAB>
and paste the /tmp/binenvdebug
file here (please sanitize any sensitive information before).
Thanks !
Hello,
I’ve try with fully clean bash or zsh environment to validate.
On Linux bash : work for first completion level. (kubectl g
On MacOS both bash (clean) or zsh (actually customized) : Completion won’t load and debug file wasn’t created. I’m assured for read/write rights on folder/file to generate debug.
========= starting completion logic ==========
cur is g, words[*] is kubectl g, #words[@] is 2, cword is 1
Truncated words[*]: kubectl g,
lastParam g, lastChar g
Calling kubectl __complete g
binenv called in shim mode for "kubectl __complete g"
The completion directive is: 4
The completions are: get Display one or many resources
Activating no file completion
__kubectl_handle_completion_types: COMP_TYPE is 9
COMPREPLY[0]: get Display one or many resources
Removed description from single completion, which is now: get
========= starting completion logic ==========
cur is p, words[*] is kubectl get p, #words[@] is 3, cword is 2
Truncated words[*]: kubectl get p,
lastParam p, lastChar p
Calling kubectl __complete get p
binenv called in shim mode for "kubectl __complete get p"
The completion directive is: 4
The completions are:
Activating no file completion
__kubectl_handle_completion_types: COMP_TYPE is 9
========= starting completion logic ==========
cur is p, words[*] is kubectl get p, #words[@] is 3, cword is 2
Truncated words[*]: kubectl get p,
lastParam p, lastChar p
Calling kubectl __complete get p
binenv called in shim mode for "kubectl __complete get p"
The completion directive is: 4
The completions are:
Activating no file completion
__kubectl_handle_completion_types: COMP_TYPE is 63
========= starting completion logic ==========
cur is p, words[*] is kubectl get p, #words[@] is 3, cword is 2
Truncated words[*]: kubectl get p,
lastParam p, lastChar p
Calling kubectl __complete get p
binenv called in shim mode for "kubectl __complete get p"
The completion directive is: 4
The completions are:
Activating no file completion
__kubectl_handle_completion_types: COMP_TYPE is 63
========= starting completion logic ==========
CURRENT: 2, words[*]: kubectl g
Truncated words[*]: kubectl g,
lastParam: g, lastChar: g
About to call: eval kubectl __complete g
binenv called in shim mode for "kubectl __complete g"
completion output: get Display one or many resources
:4
last line: :4
directive: 4
completions: get Display one or many resources
flagPrefix:
Adding completion: get:Display one or many resources
Calling _describe
_describe found some completions
========= starting completion logic ==========
CURRENT: 3, words[*]: kubectl get p
Truncated words[*]: kubectl get p,
lastParam: p, lastChar: p
About to call: eval kubectl __complete get p
binenv called in shim mode for "kubectl __complete get p"
completion output: :4
last line: :4
directive: 4
completions:
flagPrefix:
Calling _describe
_describe did not find completions.
Checking if we should do file completion.
deactivating file completion
========= starting completion logic ==========
CURRENT: 3, words[*]: kubectl get po
Truncated words[*]: kubectl get po,
lastParam: po, lastChar: o
About to call: eval kubectl __complete get po
binenv called in shim mode for "kubectl __complete get po"
completion output: :4
last line: :4
directive: 4
completions:
flagPrefix:
Calling _describe
_describe did not find completions.
Checking if we should do file completion.
deactivating file completion
Thanks !
This is weird; I have a different output here.
========= starting completion logic ==========
cur is p, words[*] is kubectl get p, #words[@] is 3, cword is 2
Truncated words[*]: kubectl get p,
lastParam p, lastChar p
Calling kubectl __complete get p
binenv called in shim mode for "kubectl __complete get p"
The completion directive is: 4
The completions are: persistentvolumeclaims
persistentvolumes
pods
podtemplates
provisioningrequests.autoscaling.x-k8s.io
prioritylevelconfigurations.flowcontrol.apiserver.k8s.io
pods.metrics.k8s.io
podmonitors.monitoring.coreos.com
probes.monitoring.coreos.com
prometheusagents.monitoring.coreos.com
prometheuses.monitoring.coreos.com
prometheusrules.monitoring.coreos.com
podmonitorings.monitoring.googleapis.com
podlogs.monitoring.grafana.com
poddisruptionbudgets.policy
priorityclasses.scheduling.k8s.io
Activating no file completion
__kubectl_handle_completion_types: COMP_TYPE is 63
What does ~/.binenv/binaries/kubectl/1.30.1 __complete get p
does return ?
And kubectl __complete get p
?
(if you're still on 1.30.1, otherwise please adjust version)
Oh well,I think this is because you do not have a connetion to a k8s API available, and the second level will check the available resources from the API:
$ kubectl __complete get p
E0627 11:08:11.427694 2431754 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused
:4
Completion ended with directive: ShellCompDirectiveNoFileComp
So this sounds normal.
For kubectl and helm completion on Linux, it’s OK
Effectively, with correct KUBECONFIG file exported, it’s OK on Linux.
But for MacOS issues stay present, and bash debug file export don’t work.
Did you follow kubectl instructions there (for bash & zsh) ? https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/#enable-shell-autocompletion
Hello, I have a Oh-my-zsh shell and ever since i installed my tools with binenv, i dont have any completions from the omz plugins kubectl and helm. I tried the binenv completion steps but it still isn't working:
The quickstart for linux didn't help either