Bug 1638447
| Summary: | oc rsh introduces 0x0d control character | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Robert Bost <rbost> |
| Component: | oc | Assignee: | Juan Vallejo <jvallejo> |
| Status: | CLOSED NOTABUG | QA Contact: | Xingxing Xia <xxia> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.10.0 | CC: | aos-bugs, jokerman, mfojtik, mmccomas, rbost |
| Target Milestone: | --- | ||
| Target Release: | 3.11.z | ||
| 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: | 2018-10-19 19:20:07 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
Robert Bost
2018-10-11 14:55:36 UTC
Is this only happening on v3.10? Could you check if this issue can also be reproduced on a newer version, such as v3.11? (In reply to Juan Vallejo from comment #1) > Is this only happening on v3.10? Could you check if this issue can also be > reproduced on a newer version, such as v3.11? Yes, still occurs in 3.10: [root@master-0 ~]# oc version oc v3.10.45 kubernetes v1.10.0+b81c8f8 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://openshift.internal.rbost310.lab.rdu2.cee.redhat.com:443 openshift v3.10.45 kubernetes v1.10.0+b81c8f8 [root@master-0 ~]# oc rsh router-1-rn6cw cat haproxy.config > myhaproxy.config [root@master-0 ~]# grep -E '^\s*bind\s+:[[:digit:]]+\w' myhaproxy.config | cut -f2 -d: | paste -d, -s ,443 Hi Robert, Thanks for confirming, however I I'd also be interested to know if you're seeing this issue on a newer client, such as 3.11? Thanks (In reply to Juan Vallejo from comment #3) > Hi Robert, > > Thanks for confirming, however I I'd also be interested to know if you're > seeing this issue on a newer client, such as 3.11? > > Thanks Yes, 3.11 is affected too [root@master-0 ~]# oc version oc v3.11.16 kubernetes v1.11.0+d4cacc0 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://openshift.internal.nimeral.lab.rdu2.cee.redhat.com:443 openshift v3.11.16 kubernetes v1.11.0+d4cacc0 [root@master-0 ~]# oc rsh router-1-9fdvl cat haproxy.config > myhaproxy.config [root@master-0 ~]# grep -E '^\s*bind\s+:[[:digit:]]+\w' myhaproxy.config | cut -f2 -d: | paste -d, -s ,443 Hi Robert, The reason for the extra control character in the line-endings when using `oc rsh`, is because the `rsh` command requests a pseudo-terminal to be allocated by default. Running `rsh` with the flag `--no-tty` fixes this issue: ``` $ oc rsh router-1-... cat haproxy.config > myhaproxy.config $ grep -E '^\s*bind\s+:[[:digit:]]+\w' myhaproxy.config | cut -f2 -d: | paste -d, -s 80,443 ``` Correction to the example command in comment 5 (adding --no-tty flag): ``` $ oc rsh --no-tty router-1-... cat haproxy.config > myhaproxy.config $ grep -E '^\s*bind\s+:[[:digit:]]+\w' myhaproxy.config | cut -f2 -d: | paste -d, -s 80,443 ``` Is this something worth submitting a patch for? Something that keep newlines consistent based on client os? > Is this something worth submitting a patch for? Something that keep newlines consistent based on client os? This would most likely have to be a patch made against the docker term[1] package, which the rsh and exec commands depend on. You're welcome to make a patch there as you see fit, but considering that there is an option that allows `rsh` to behave exactly the same as `oc exec` (--no-tty), I do not think it is necessary. 1. https://github.com/moby/moby/tree/master/pkg/term |