Bug 1330845

Summary: Some oc commands usage may be misleading due to options put after COMMAND such as oc set probe, oc debug etc
Product: OpenShift Container Platform Reporter: Dongbo Yan <dyan>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED DUPLICATE QA Contact: Wei Sun <wsun>
Severity: low Docs Contact:
Priority: low    
Version: 3.2.0CC: aos-bugs, jokerman, mmccomas, xxia
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-06-07 06:29:57 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 Dongbo Yan 2016-04-27 06:50:06 UTC
Description of problem:
Using "oc set probe" command to set a probe in dc, when set an exec action(-- cmd) as a  probe in front of other options, other options will be a part of exec action, not independent option. 
Better to enhance usage info, like :  oc exec [options] POD [-c CONTAINER] -- COMMAND [args...]


Version-Release number of selected component (if applicable):
openshift v3.2.0.20
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5

How reproducible:
Always

Steps to Reproduce:
1.Create a project, and create a dc
2.set an exec action(-- cmd) as a  probe in front of other options,
$ oc set probe dc/mysql --liveness -- echo ok --period-seconds=20
3.when pod is running, check the probe in pod
$ oc describe pod mysql-2-tx02a

Actual results:
In step3:
 Liveness:		exec [echo ok --period-seconds=20] delay=0s timeout=1s period=10s #success=1 #failure=3

Expected results:
 Liveness:		exec [echo ok] delay=0s timeout=1s period=20s #success=1 #failure=3

Additional info:
when set an exec action(-- cmd) behind other options, like:$ oc set probe dc/mysql --liveness --period-seconds=20 -- echo ok , the result will be correct.

Comment 1 Xingxing Xia 2016-05-10 02:36:07 UTC
oc debug -h also shows:
Usage:
  oc debug RESOURCE/NAME [ENV1=VAL1 ...] [-c CONTAINER] [-- COMMAND] [options]

[options] is put after [-- COMMAND].

Though user may fix his bad experience if he knows the meaning of bash "--", it is better to adjust [options] before [-- COMMAND] in help info to avoid possible bad experience. For future new sub command like this, needs avoid it too.

Comment 2 Xingxing Xia 2016-06-07 06:29:57 UTC

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