Bug 2110359 - oc get stopped doing completion on tab.
Summary: oc get stopped doing completion on tab.
Keywords:
Status: CLOSED DUPLICATE of bug 2107003
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.11
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Jan Chaloupka
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-25 10:12 UTC by Shay Rozen
Modified: 2022-08-03 10:01 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-03 10:01:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Shay Rozen 2022-07-25 10:12:29 UTC
Description of problem:
In the past when doing "oc get p<tab>" the tab would bring from server resource that are starting with "p", or "oc get pods <tab>" would bring all the pods in the namespace.
The functionality is still working with "oc delete/patch/project/describe/edit"  and all the other sub-commands. Only for "oc get" the tab output is local files instead of server resource.


Version-Release number of selected component (if applicable):
 4.11.0-0.nightly-2022-07-24-151159

How reproducible:
100%

Steps to Reproduce:
1. source <(oc completion bash)
2. Do "oc get <tab>" or "oc get pods <tab>"
3. Check output.

Actual results:
Local files are shown instead of server resource when using get commands.

[srozen@srozen-lap 4.11]$ oc get pods 
~/                                     lvm-bundle.yaml                        operator_sub.yaml                      sub.yaml
bigger.log                             lvm-cluster-thin.yaml                  pod-block.yaml                         test-auto/
BZ/                                    lvm-cluster.yaml                       pod-mixed.yaml                         test-me/


Expected results:
The tab should show server resource instead of local files like oc delete and all the others sub command other than get that work.

[srozen@srozen-lap 4.11]$ oc delete s
schedulers.config.openshift.io                    servicemonitors.monitoring.coreos.com             storagestates.migration.k8s.io
secrets                                           services                                          storageversionmigrations.migration.k8s.io
securitycontextconstraints.security.openshift.io  statefulsets.apps                                 subscriptions.operators.coreos.com
serviceaccounts                                   storageclasses.storage.k8s.io                     
servicecas.operator.openshift.io                  storages.operator.openshift.io                    

[srozen@srozen-lap 4.11]$ oc delete pods 
lvm-operator-controller-manager-7cbc49fc6d-4j2zw  topolvm-node-lbjg2                                
topolvm-controller-58bbf455f5-4tfmf               vg-manager-tpqr4                                  


Additional info:

Comment 1 Jan Chaloupka 2022-07-29 16:52:13 UTC
Hello Shay,

checking with 4.12.0-0.nightly-2022-07-07-144231 on Fedora 32 with bash-5.0.17-1.fc32.x86_64 I am not able to reproduce the issue. When doing "oc get <tab>", "oc get pods <tab>" I get the resources, resp. pods.
```
$ oc get <tab>
Display all 188 possibilities? (y or n)
$ oc get pod<tab>
poddisruptionbudgets.policy                                      pods                                                             podtemplates
podmonitors.monitoring.coreos.com                                podsecuritypolicies.policy                                       
podnetworkconnectivitychecks.controlplane.operator.openshift.io  pods.metrics.k8s.io     
```

When doing "$ oc get pods <tab>" the command changes into "$ oc get pods sso". For namespaces:
```
$ oc get ns <tab>
default                                           openshift-cluster-storage-operator                openshift-ingress                                 openshift-multus
kube-node-lease                                   openshift-cluster-version                         openshift-ingress-canary                          openshift-network-diagnostics
...
```

When building and running oc from the latest release-4.11 head I am still not able to reproduce it.

What operating system/bash version are you using?

Comment 2 Shay Rozen 2022-08-03 05:27:06 UTC
Hi Jan, the problem occurred while using 4.11.0-0.nightly-2022-07-24-151159 and still happens with the newer 4.11 nightly. 
Maybe it got fixed in 4.12 somehow but still happens in 4.11 which the BZ was raised on.

Comment 3 Arda Guclu 2022-08-03 09:48:11 UTC

*** This bug has been marked as a duplicate of bug 2101885 ***

Comment 4 Shay Rozen 2022-08-03 09:53:22 UTC
I'm reopening.  https://bugzilla.redhat.com/show_bug.cgi?id=2101885 is about 4.12. This is around 4.11.

Comment 5 Arda Guclu 2022-08-03 10:01:16 UTC
I set duplicate id of 4.12.

This is 4.11 https://bugzilla.redhat.com/show_bug.cgi?id=2107003
and this https://github.com/openshift/oc/pull/1206  is the patch waiting to be approved.

Comment 6 Arda Guclu 2022-08-03 10:01:26 UTC

*** This bug has been marked as a duplicate of bug 2107003 ***


Note You need to log in before you can comment on or make changes to this bug.