Bug 1287981 - "oc get" should indicate the right argument when prompting no resource is defined
"oc get" should indicate the right argument when prompting no resource is def...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
Wei Sun
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-03 03:44 EST by Xingxing Xia
Modified: 2016-05-12 13:14 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 13:14:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Xingxing Xia 2015-12-03 03:44:31 EST
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 14:10:59 EST
Fixed in master.
Comment 2 Xingxing Xia 2016-02-02 20:09:24 EST
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.