Commit Graph

22 Commits

Author SHA1 Message Date
Maciej Szulik
eff4f79eda
Remove dead code used only in tests 2019-09-05 09:17:56 +02:00
Maciej Szulik
786acdb668
Remove symlink support from kubectl cp 2019-09-03 10:42:30 +02:00
Maciej Szulik
ab1c56ae87
Move kubectl cp back to k/k 2019-08-29 09:00:47 +02:00
Sean Sullivan
0e0ea52339 Move pkg/kubectl/cmd/{command} to staging 2019-08-01 11:01:40 -07:00
Tim Allclair
9ba6fe8810 refactors to kubernetes cp command 2019-07-22 13:25:13 -07:00
M00nF1sh
bad1802892 refactors to kubernetes CP command 2019-07-22 10:33:19 -07:00
Sean Sullivan
67140f13fe Updated dependencies: BUILD/modules.txt 2019-07-18 15:43:26 -07:00
Sean Sullivan
140c62cd4c Update all imports to scheme in staging 2019-07-18 15:32:27 -07:00
Kubernetes Prow Robot
75a39b7007
Merge pull request #73982 from tanshanshan/fixcp
fix cp time stamp is in the future error
2019-07-02 22:48:29 -07:00
yanghaichao12
e21ce73fba Refactor:move clean method to suitable place 2019-05-07 14:23:30 -04:00
Maciej Szulik
7962231a80
Properly handle links in tar 2019-04-26 22:19:44 +02:00
Tim Allclair
a867b399af
Test kubectl cp escape 2019-04-26 22:19:39 +02:00
Maciej Szulik
ee7edb7765
Fix panic in kubectl cp command 2019-03-06 15:43:15 +01:00
tanshanshan
e959d477bb fix cp time stamp is in the future error 2019-02-13 09:47:47 +08:00
Di Xu
6576e1f790 kubectl supports copying files with wild card 2019-01-22 15:56:13 +08:00
k8s-ci-robot
64b96d426a
Merge pull request #69885 from clickyotomy/master
Fix local copy path for `kubectl cp'.
2018-11-28 23:31:21 -08:00
k8s-ci-robot
00dd32b167
Merge pull request #69573 from bjhaid/master
Opt out of chowning and chmoding from kubectl cp.
2018-10-18 14:43:49 -07:00
bjhaid
44bed94f0e Opt out of chowning and chmoding from kubectl cp.
`kubectl cp` relies on tar to extract the copied file/directory in the
container, tar by default attempts to chown/chmod the extracted file
after extraction if the user is the "superuser"(root)

```
--same-owner
try extracting files with the same ownership as exists in the archive
(default for superuser)
-p, --preserve-permissions, --same-permissions
extract information about file permissions (default for superuser)
```

This fails in environment where the container runs as root but is not
granted the OWNER or CHOWN capability.

Before this patch below was the behavior of `kubectl cp`

```
kubectl cp README.md foo-67b6fcbd4c-qjlt6:/tmp
tar: README.md: Cannot change ownership to uid 1000, gid 1000: Operation
not permitted
tar: Exiting with failure status due to previous errors
command terminated with exit code 2
kubectl exec -it foo-67b6fcbd4c-qjlt6 -- ls -l /tmp/README.md
-rw------- 1 1000 1000 3179 Oct  7 22:00 /tmp/README.md
```

After this patch

```
kubectl cp -x a foo-67b6fcbd4c-qjlt6:/
kubectl exec -it foo-67b6fcbd4c-qjlt6 -- ls -l /tmp/README.md
-rw-r--r-- 1 root root 3179 Oct  7 22:00 /tmp/README.md
```
2018-10-18 14:16:06 +00:00
Srinidhi Kaushik
d17ce325a6
Fix local copy path for `kubectl cp'.
Adds an extra check condition for "." in stripPathShortcuts
so that an empty string is returned, and the correct prefix
index is used untarAll when generating path names.

Resolves: #69804.
2018-10-16 20:11:54 +05:30
juanvallejo
e55a28d169
fix paths w shortcuts when copying from pods
Addresses an issue where copying from a remote location containing path
shortcuts (podName:../../../tmp/foo) causes an index out of range panic.
2018-10-09 10:27:54 -04:00
Maciej Szulik
55d5df8a36
React to moves 2018-10-06 18:44:05 +02:00
Maciej Szulik
33adf367f9
Move each kubectl command to a separate directory 2018-10-06 18:44:05 +02:00