Closed hhallman closed 6 months ago
This issue is currently awaiting triage.
If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted
label and provide further guidance.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
/sig cli
Hi,
Thank you for considering my change request. This is my first contact with the k8s project, and I would love to get the chance to make this change myself is feasible. I have found the relevant place in the kubectl codebase. I have read the contribution guidelines and followed them as best as I can. Sorry beforehand if I did something incorrectly.
Thank you!
i think it is better to be transferred to kubectl /transfer kubectl
I struggled with this same problem, so I created a small program called kubectl-cp that has no dependencies and allows me to freely copy files between containers running on Kubernetes:
https://github.com/marcio-pessoa/kubectl-cp
I hope this can help.
Thanks for opening this detailed issue. Your request is valid but we think of tar here as an (unfortunate) implemntation detail for copy.
In general, for all of the "remote" commands we combine both streams into stdout. The design choice here is to reserve stderr for actual command feedback of the kubectl command you are running.
We're actually drafting up a new proposal to move copy logic down into the container runtime and do away with the requirement for tar with kubectl cp. Stay tuned for that.
/close
@eddiezane: Closing this issue.
Thank you @eddiezane for your consideration and feedback. As you may see in my details, the workaround for this issue is very simple, so no problem.
What happened?
When using
kubectl cp
, it seems that tar's stderr output is sent to kubectl's stdout. In my case, this behavior interfers with a script.Notice how tar prints to stderr:
However, when using kubectl cp, the output is sent to stdout:
What did you expect to happen?
I would expect the tar output to be sent to stderr
How can we reproduce it (as minimally and precisely as possible)?
Check that stdout does NOT have the leading / warning:
Check that stderr DOES have the leading / warning:
Anything else we need to know?
My reason for requesting this change is that the following script would be easier to write and more intuitive
After the requested change:
The getReport function is further used as so:
As you can see,
publishReport
depends on the output fromgetReport
to be clean, which it will not be ifkubectl
prints to stdout.Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)