Bug 1388039 - [userinterface_public_451] Should suggest to use `describe` to obtain container names
Summary: [userinterface_public_451] Should suggest to use `describe` to obtain contain...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-24 09:54 UTC by XiaochuanWang
Modified: 2016-10-26 09:36 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-26 09:36:54 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description XiaochuanWang 2016-10-24 09:54:02 UTC
Description of problem:
US https://trello.com/c/04lpfTQR/451-8-cli-improved-flows-and-ux-in-the-cli-evg-ux-p3#comment-57dfb28c111e96f56689e35f
PR: https://github.com/openshift/origin/pull/10360
Required by US and PR, some command helper info should suggest to use `describe` to obtain container names.

Version-Release number of selected component (if applicable):
oc v3.4.0.14

How reproducible:
Always

Steps to Reproduce:
1. # oc exec -h

2. check other commands
oc rsh -h
oc rsync -h
oc debug -h
oc attach -h
oc logs -h

Actual results:
Both step 1 and step 2 - Message "Use "oc describe POD" to obtain container name values for a pod." lost from output.

Expected results:
There should be two lines of message at the end of output:
Use "oc describe POD" to obtain container name values for a pod.
Use "oc options" for a list of global command-line options (applies to all commands).

Additional info:

Comment 1 Juan Vallejo 2016-10-24 13:43:11 UTC
This was fixed in this PR: https://github.com/kubernetes/kubernetes/pull/30717/ for `oc exec` and `oc rsh`. The reason you are not seeing it, is because it is only printed out when a pod has more than one container: https://github.com/kubernetes/kubernetes/pull/30717/files#diff-de6f7fc4d605130323893d0b7572045eR267

I'll look into it for the rest of the commands

Comment 2 Juan Vallejo 2016-10-24 20:21:54 UTC
Verified the following commands:
```
oc rsh
oc rsync
oc debug
oc attach
```

A message appears for each of them when there is more than one container in a specified pod, suggesting the use of `oc describe POD`. https://github.com/kubernetes/kubernetes/pull/30717/files#diff-de6f7fc4d605130323893d0b7572045eR267

```
$ oc exec idling-echo-2-96d7a -- /bin/sh -c "echo testoutput"
Defaulting container name to idling-tcp-echo.
Use 'oc describe pod/idling-echo-2-96d7a' to see all of the containers in this pod.
testoutput
```

This message appears when the command is executed, rather than in its help output due to this: https://github.com/openshift/origin/pull/10360/files#r74972619

In the case of `oc logs`, the following output appears when running the command without specifying a container name:

```
$ oc logs idling-echo-2-96d7a
Error from server: a container name must be specified for pod idling-echo-2-96d7a, choose one of: [idling-tcp-echo idling-udp-echo]
```

Comment 3 XiaochuanWang 2016-10-25 06:32:03 UTC
According to explanation, this bug could be verified, but from US and PR mentioned in Description: https://github.com/openshift/origin/pull/10360, I wonder if the design has been changed. This bug is pending on confirm for design now.

Test steps:
1. oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/deployment/dc-with-two-containers.yaml
2. When deployed pod is running: # oc exec dctest-1-xip9m -- date

Comment 4 Juan Vallejo 2016-10-25 13:46:46 UTC
Sorry about the confusing PR description, yes, design changed after that PR was merged. The original intent was to suggest `oc describe...` in the help output of a command that had the `--container` option, however it was decided that a better approach would be to display this message whenever the command was executed on a pod with more than one container, per this PR https://github.com/openshift/origin/pull/10469

I have updated the PR's (https://github.com/openshift/origin/pull/10360) description to reflect this.

Comment 5 XiaochuanWang 2016-10-26 01:35:24 UTC
Verified according to comment 3 and comment 4, the design has been updated, this is not a bug.


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