Bug 1309874

Summary: if specifying --config in oc new-app --search with an invalid option, the order of where to put the --config option makes a difference to the returned output
Product: OKD Reporter: Peter Ruan <pruan>
Component: ocAssignee: Ben Parees <bparees>
Status: CLOSED NOTABUG QA Contact: Wei Sun <wsun>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.xCC: aos-bugs, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-19 17:42:18 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:

Description Peter Ruan 2016-02-18 21:07:00 UTC
Description of problem:
if specifying --config in oc new-app --search with an invalid option, the order of where to put the --config option makes a difference to the returned output Looks like the order where I put --config matters in this case.

*** put --config at the end of cmd line
oc new-app --search --docker-image --config=/home/pruan/workdir/dhcp-16-164-pruan/ose_pruan1.kubeconfig                                           [ruby-2.2.3]
error: No configuration file found, please login or point to an existing file:

  1. Via the command-line flag --config
  2. Via the KUBECONFIG environment variable
  3. In your home directory as ~/.kube/config

To view or setup config directly use the 'config' command.

*** put --config at the middle of the cmd line
$ oc new-app --config=/home/pruan/workdir/dhcp-16-164-pruan/ose_pruan1.kubeconfig --search --docker-image                       

                   
Error: flag needs an argument: --docker-image




Version-Release number of selected component (if applicable):
oc v1.1.3-40-g678463c
kubernetes v1.2.0-alpha.7-703-gbc4550d


How reproducible:
always.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ben Parees 2016-02-18 22:19:23 UTC
This is working correctly.  --docker-image needs an additional argument.  Since you aren't specifying an actual image, the --config=foo is being treated as that additional argument.  Since --config=foo was consumed as the argument to --docker-image, you are not supplying a --config argument, so you get an error that there is no configuration.

Comment 2 Ben Parees 2016-02-18 22:20:32 UTC
(and of course in the second case you're correctly being told that you need to specify an additional argument to --docker-image)