javascript icon indicating copy to clipboard operation
javascript copied to clipboard

cpFromPod / cpToPod is missing --retries flag

Open PeterEinberger opened this issue 3 years ago • 2 comments

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.

PeterEinberger avatar Nov 09 '23 10:11 PeterEinberger

the logic in kubectl is pretty complicated. Someone will need to port that logic into the copy logic in this client.

brendandburns avatar Nov 10 '23 18:11 brendandburns

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.

Knickkennedy avatar Mar 24 '24 21:03 Knickkennedy