| Summary: | [userinterface_public_451] Should suggest to use `describe` to obtain container names | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | XiaochuanWang <xiaocwan> |
| Component: | oc | Assignee: | Juan Vallejo <jvallejo> |
| Status: | CLOSED NOTABUG | QA Contact: | Xingxing Xia <xxia> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.4.0 | CC: | aos-bugs, jokerman, jvallejo, mmccomas |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-10-26 09:36:54 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
XiaochuanWang
2016-10-24 09:54:02 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 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. |