cpFromPod / cpToPod is missing --retries flag
Describe the bug
cpFromPod / cpToPod silently fail on larger files, resulting in incomplete files.
** Client Version **
0.20.0
** Server Version **
1.25.7+rke2r1
To Reproduce upload a larger file, at least 200MB. The kubernetes issue has gone into detail about network settings a.s.o.
Expected behavior
cpFromPod / cpToPod should try to upload the whole file or error out on premature disconnect.
Environment (please complete the following information):
- OS: Linux
- NodeJS Version 20
Additional context
Has been identified and 'fixed' in kubectl cp https://github.com/kubernetes/kubernetes/issues/60140 with the --retries flag.
the logic in kubectl is pretty complicated. Someone will need to port that logic into the copy logic in this client.
I noticed that in kubectl cp that it looks like the tar.Read just uses a byte stream to capture where it left off and continue. Could that logic be replicated here? Basically just create an io pipe and keep track of where we are in the bytes? Also sorry if this is out of left field, I'm new to contributing to Kubernetes in any capacity.