Description of problem: When piping output from "oc rsh", CRLF characters are inserted changing the original output. "oc exec" does not modify the output. Version-Release number of selected component (if applicable): oc v3.10.89 openshift v3.10.89 kubernetes v1.10.0+b81c8f8 How reproducible: Always Steps to Reproduce: 1. oc project <some_project> 2. oc exec <podname> cat somefile > outfile.exec 3. oc rsh <podname> cat somefile > outfile.rsh Actual results: [root@test ~]# oc project default Already on project "default" on server "https://test.example.com:8443". [root@test ~]# oc exec router-1-4w5w5 cat haproxy-config.template > haproxy-config.template.exec [root@test ~]# oc rsh router-1-4w5w5 cat haproxy-config.template > haproxy-config.template.rsh [root@test ~]# ls -la haproxy-config.template.* -rw-r--r--. 1 root root 28002 Jan 23 14:30 haproxy-config.template.exec -rw-r--r--. 1 root root 28558 Jan 23 14:30 haproxy-config.template.rsh [root@test ~]# file haproxy-config.template.exec haproxy-config.template.exec: ASCII text, with very long lines [root@test ~]# file haproxy-config.template.rsh haproxy-config.template.rsh: ASCII text, with very long lines, with CRLF line terminators md5sum within running container. sh-4.2$ md5sum haproxy-config.template 6fb15bc4f46c731054f05fa988579d2e haproxy-config.template md5sum of output files. [root@test ~]# md5sum haproxy-config.template.* 6fb15bc4f46c731054f05fa988579d2e haproxy-config.template.exec 491b27fbeb8ef13b5e5027fcea1a7af4 haproxy-config.template.rsh Expected results: Output should not be modified. Additional info:
`oc rsh` attaches a tty by default. Do you still see extra chars inserted in your output after running `oc rsh --no-tty=true ...` ? This could be a possible duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1638447
Thank you for the clarification. With 'oc rsh --no-tty=true' the output matches that of the file inside the container. I will file a separate docs bug against the "bare" oc rsh usage we advise for copying the haproxy configuartion files in the customizing haproxy section of the docs as that is where this issue has come up and in the linked bz 1638447. [1] We should probably be recommending either 'oc exec' or 'oc cp' usage rather than 'oc rsh'. [1] https://docs.openshift.com/container-platform/3.10/install_config/router/customized_haproxy_router.html#obtaining-router-configuration-template
> We should probably be recommending either 'oc exec' or 'oc cp' usage rather than 'oc rsh'. Yes, I definitely agree. Thanks for confirming `oc rsh --no-tty` matches the desired output. Closing this as NOTABUG.