Bug 1389208
Summary: | Lost suggestion to use describe to obtain container names in several commands | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | XiaochuanWang <xiaocwan> |
Component: | oc | Assignee: | Maciej Szulik <maszulik> |
Status: | CLOSED ERRATA | QA Contact: | XiaochuanWang <xiaocwan> |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | 3.4.0 | CC: | aos-bugs, jokerman, mmccomas, xxia |
Target Milestone: | --- | ||
Target Release: | 4.1.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | No Doc Update | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-06-04 10:40: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: | |
Embargoed: |
Description
XiaochuanWang
2016-10-27 07:59:59 UTC
This is still reproduced on OCP 3.7.14 now: Pod with multiple containers is failed to sync file from container, but single container pod could. Created /tmp/test.txt in pod "dctest-1-lh0mf", container 1 "dctest-1" and then do: [xiaocwan@dhcp-141-172 aaa]$ oc rsync -c dctest-1 dctest-1-lh0mf:/tmp/test.txt /home/xiaocwan/tmp/aaa/ WARNING: cannot use rsync: rsync not available in container WARNING: cannot use tar: tar not available in container error: No available strategies to copy. So as to oc attach <multi-container-pod>, it doesn't show which container it uses: $ oc attach dctest-1-lh0mf If you don't see a command prompt, try pressing enter. Started, serving at 8080 oc debug also reproduces on OCP 3.7, there should be a "oc describe" indication and a current running container $ oc debug dctest-1-btzvk Debugging with pod/dctest-1-btzvk-debug, original command: /hello-openshift Waiting for pod to start ... Pod IP: 10.128.0.65 If you don't see a command prompt, try pressing enter. sh-4.2$ Tested on v3.9.0-0.41.0 pod with multiple containers does suggest the way to get a container by `oc rsh` $ oc rsh dctest-1-jqv8b Defaulting container name to dctest-1. Use 'oc describe pod/dctest-1-jqv8b -n xiaocwan-t' to see all of the containers in this pod. However, not all command in step 3(Try following commands) also needs the clear suggestion message such as: $ oc rsync /home/xiaocwan/tmp/tmp dctest-1-jqv8b:/tmp WARNING: cannot use rsync: rsync not available in container rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused \"exec: \\\"tar\\\": executable file not found in $PATH\"\n" WARNING: cannot use tar: tar not available in container error: No available strategies to copy. Could you please help to update them as well, thanks! Looks like the code in comment 3 doesn't check pod container number=1 or >1. Test result of oc v3.10.0-0.54.0 for pod that only has 1 container: $ oc debug pod/ruby-ex-1-4gxnf -t Defaulting container name to ruby-ex. Use 'oc describe pod/ruby-ex-1-4gxnf-debug -n xxia-proj' to see all of the containers in this pod. ... It should not give the suggestion when there is only 1 container This was fixed in https://github.com/openshift/origin/pull/21997 moving to qa. Most commands are fixed on oc v4.0.2 as below but miss one: $ oc exec dctest-1-xd462 -- date Defaulting container name to dctest-1. Use 'oc describe pod/dctest-1-xd462 -n xiaocwan-t' to see all of the containers in this pod. Wed Feb 27 02:42:07 UTC 2019 $ oc rsh dctest-1-xd462 date Defaulting container name to dctest-1. Use 'oc describe pod/dctest-1-xd462 -n xiaocwan-t' to see all of the containers in this pod. Wed Feb 27 02:44:41 UTC 2019 $ oc rsync /home/xiaocwan/tmp/tmp dctest-2-6kv5t:/tmp/ sending incremental file list tmp/ sent 45 bytes received 19 bytes 18.29 bytes/sec total size is 0 speedup is 0.00 Defaulting container name to dctest-1. Use 'oc describe pod/dctest-2-6kv5t -n xiaocwan-t' to see all of the containers in this pod. $ oc debug dctest-2-6kv5t Defaulting container name to dctest-1. Use 'oc describe pod/dctest-2-6kv5t-debug -n xiaocwan-t' to see all of the containers in this pod. $ oc attach dctest-2-6kv5t Defaulting container name to dctest-1. Use 'oc describe pod/ -n xiaocwan-t' to see all of the containers in this pod. If you don't see a command prompt, try pressing enter. running .... Only left one command: $ oc logs -f dctest-2-6kv5t Error from server (BadRequest): a container name must be specified for pod dctest-2-6kv5t, choose one of: [dctest-1 dctest-2] So is this one by design? > So is this one by design?
Yes, the remaining commands have a different logic underneath it, also with recent in kubectl (might not be in oc, yet) changes we'll nicely allow logs from multiple containers.
Moving back to qa.
Comment 8 is well explained and could be accepted by user, it could be Verified by 4.1 Thank you all! Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0758 |