kubectl cp a file from a Windows Pod to Windows 11 localhost failed
GoingMyWay opened this issue · comments
What happened?
I was trying to cp a from a Windows Pod to the Windows localhost. But it failed.
kubectl.exe cp --kubeconfig .\kubconfig -n namespace-win pod-20240509-120334-779546rrfsc:C:\\data\\0509-1065.log 0509-1065.log
It showed
tar: Removing leading drive letter from member names
error: tar contents corrupted
What did you expect to happen?
I want to copy the file to the localhost.
How can we reproduce it (as minimally and precisely as possible)?
Windows 11 localhost
Windows Pod.
Anything else we need to know?
No response
Kubernetes version
$(powershell) kubectl version
# paste output here
Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Unable to connect to the server: dial tcp 127.0.0.1:6443: connectex: No connection could be made because the target machine actively refused it.
Cloud provider
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
BuildNumber Caption OSArchitecture Version
22621 Microsoft Windows 11 Professional 64-bit 10.0.22621
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
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.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/sig windows
Try this way
kubectl.exe cp --kubeconfig .\kubconfig -n namespace-win pod-20240509-120334-779546rrfsc:C:/data/0509-1065.log
./0509-1065.log