Bug 2080416

Summary: oc bash-completion problem
Product: OpenShift Container Platform Reporter: Divyam Pateriya <dpateriy>
Component: ocAssignee: Arda Guclu <aguclu>
oc sub component: oc QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: aguclu, aos-bugs, gakendre, mfojtik, sparpate, wweber
Version: 4.10   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: oc project <tab-completion> causes oc project project Consequence: users can not use tab completion for oc project command Fix: oc project <tab-completion> will list projects Result:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:09:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2084429    

Description Divyam Pateriya 2022-04-29 15:29:37 UTC
Description of problem:
oc bash-completion problem on oc project command


Version-Release number of selected component (if applicable):
# oc version
  Client Version: 4.10.10
  Server Version: 4.10.10
  Kubernetes Version: v1.23.5+9ce5071

How reproducible:
100%

Steps to Reproduce:
1. # oc completion bash > oc_bash_completion
2. # source oc_bash_completion
3. # export KUBECONFIG=kubeconfig

Actual results:

# oc proj[TAB]
  ├> oc project [TAB]
  | Here it should print project names. But I get
  ├> oc project project
  └> oc project project [TAB]

Expected results:

The oc cli should print the project names when pressing TAB after "oc project [TAB]" command. 

Additional info:

Comment 5 zhou ying 2022-05-07 10:05:42 UTC
oc project [TAB] will show all the projects now:

oc project 
testpforzy  zhouyttt2


oc projects
You have access to the following projects and can switch between them with ' project <projectname>':

  * testpforzy
    zhouyttt2

Using project "testpforzy" on server "https://api.yinzhou-07a.qe.gcp.devcluster.openshift.com:6443".


oc version --client
Client Version: 4.11.0-202205070617.p0.g0bf70d5.assembly.stream-0bf70d5
Kustomize Version: v4.5.4

Comment 6 Arda Guclu 2022-05-12 06:36:39 UTC
Backport to 4.10 PR has been opened https://github.com/openshift/oc/pull/1131

Comment 7 Maciej Szulik 2022-05-25 10:30:12 UTC
*** Bug 2087079 has been marked as a duplicate of this bug. ***

Comment 9 errata-xmlrpc 2022-08-10 11:09:50 UTC
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 (Important: OpenShift Container Platform 4.11.0 bug fix and security update), 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/RHSA-2022:5069