Bug 1287981 - "oc get" should indicate the right argument when prompting no resource is defined
Summary: "oc get" should indicate the right argument when prompting no resource is def...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-03 08:44 UTC by Xingxing Xia
Modified: 2016-05-12 17:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 17:14:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xingxing Xia 2015-12-03 08:44:31 UTC
Description of problem:
When given undefined resource name in the command line, oc get should indicate the right argument.
Some other oc commands such as oc export, oc env have the same problem.

Version-Release number of selected component (if applicable):
openshift/oc v1.1-309-g0395edb
kubernetes v1.1.0-origin-1107-g4c8e6f4

How reproducible:
Always

Steps to Reproduce:
1. Start openshift, oc login and create a project
2. Create new app
$ oc new-app -f origin/examples/sample-app/application-template-stibuild.json
$ oc get dc
3. Try to run and compare the following:
1> $ oc get abc/database
2> $ oc get abc database

3> $ oc env dc/database MY_ENV
4> $ oc env dc/database MY_ENV-

5> $ oc export /dc/database


Actual results:
3.
1>
error: no resource "database" is defined for group ""
2>
error: no resource "abc" has been defined
3>
error: no resource "database" is defined for group ""
4>
deploymentconfig "database" updated
5>
error: no resource "dc" has been defined


Expected results:
3.
1> should indicate "abc" not defined like 2>.
3> should indicate "MY_ENV" not defined rather than "database".
5> should not prompt "dc" not defined.

Additional info:

Comment 1 Fabiano Franz 2016-02-02 19:10:59 UTC
Fixed in master.

Comment 2 Xingxing Xia 2016-02-03 01:09:24 UTC
Thank Fabiano Franz.

(In latest version openshift/oc v1.1.1-361-g6408278, kubernetes v1.2.0-alpha.4-851-g4a65fa1) Following the steps in bug description, verified the bug, and actual results are:
3.
1> error: in version and kind for resource, no resource "abc" has been defined
3> when passing arguments in resource/name form, all arguments must include the resource
5> arguments in resource/name form may not have more than one slash

The bug is fixed. So move to VERIFIED.


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