Hide Forgot
Description of problem: Version-Release number of selected component (if applicable): [root@ocpbox ~]# oc version oc v3.11.16 kubernetes v1.11.0+d4cacc0 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://loadbalancer1.8670.internal:443 openshift v3.11.16 kubernetes v1.11.0+d4cacc0 How reproducible: Steps to Reproduce: 1. source <(oc completion bash) 2. then try to type oc {get,describe} {any object} and competion will not work 3. then you can try again different way how to resolve the issue 4. oc completion bash > bash_completion.sh 5. source bash_completion.sh and the completion will still not work. Actual results: no completion in subcommands - like oc {get, describe} {anyObject} Expected results: completion of e.g. oc get {possible sub sub commands services, deploymentconfig, pods, etc} Additional info:
What version of Bash are you using? Also could you ensure that you have the "bash-completion" package installed? ("sudo dnf install bash-completion" in Fedora) Additionally, if you do have bash-completion already installed, could you try placing the output of `oc completion bash` under "/etc/bash_completion.d/oc_completion"? (oc completion bash > /etc/bash_completion.d/oc_completion")
(In reply to Juan Vallejo from comment #1) > What version of Bash are you using? [root@bastion ~]# bash -version GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) > Also could you ensure that you have the "bash-completion" package installed? [root@bastion ~]# rpm -qa|grep bash-completion bash-completion-2.1-6.el7.noarch > ("sudo dnf install bash-completion" in Fedora) > > Additionally, if you do have bash-completion already installed, could you > try placing the output of `oc completion bash` under > "/etc/bash_completion.d/oc_completion"? (oc completion bash > > /etc/bash_completion.d/oc_completion") This was already done as well. I have tried to fix that in many ways. Have you tried that? My colleague who tested this for me as well on different environment confirmed, that the completion of oc sub sub commands are working on 3.9 but not on 3.11.
I can reproduce with oc 3.11 (latest 3.11.44) given bash-completion is already installed. $ oc completion bash > bash_completion.sh $ source bash_completion.sh # same result if `yum install atomic-openshift-clients -y` and `source /etc/bash_completion.d/oc` $ oc ge<tab> # can auto complete `get` $ oc create sec<tab> # can auto sub command `secret` But: $ oc get proj<tab> # cannot auto complete project $ oc get deploy<tab> # cannot auto complete deploymentconfig $ oc get rout<tab> # cannot auto complete route ... all resource type names cannot be auto-completed oc 3.9 (latest 3.9.51) does NOT have above issues (but it DOES reproduce bug 1534371, and it can NOT auto complete svc/service NOW whereas 1534371#c0 can)
I cannot complete any object after subcommand (the verb) - e.g. oc <tab> will list me everything what is possible, but after subcommands oc {get,describe,edit,export} <tab> will not list nor autocomplete anything. [root@bastion ~]# oc version oc v3.11.16 kubernetes v1.11.0+d4cacc0 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://loadbalancer1.8670.internal:443 openshift v3.11.16 kubernetes v1.11.0+d4cacc0 [root@bastion ~]# bash -version GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. [root@bastion ~]# uname -a Linux bastion.8670.example.opentlc.com 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux [root@bastion ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.5 (Maipo)
I am not able to reproduce this with a 4.0 client. Tested with both bash and zsh: ``` $ oc version oc v4.0.0-alpha.0+5974351-741-dirty kubernetes v1.11.0+59743510d0 features: Basic-Auth GSSAPI Kerberos SPNEGO $ source <(oc completion bash) $ oc ge<tab> # auto-completes to "get" $ oc create sec<tab> # auto completes "secret" $ oc get replicationc<tab> # auto-completes "replicationcontrollers" $ oc get pods <tab> # suggests all pods in current namespace # openshift-specific resources $ oc get proj<tab> # auto-completes to "projects.project.openshift.io" $ oc get projects.project.openshift.io <tab> # suggests all available projects $ oc get deployment<tab> # suggests: deploymentconfigs.apps.openshift.io, deployments.apps deployments.extensions $ oc get deploymentconfigs.apps.openshift.io # suggests all dc's in current project ``` This is not a release blocker.
Confirmed with latest version, the issue has fixed: [root@dhcp-140-138 ~]# oc version oc v4.0.0-0.82.0 kubernetes v1.11.0+6855010f70
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0758