Hide Forgot
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:
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
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] ```
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
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.
Verified according to comment 3 and comment 4, the design has been updated, this is not a bug.