Commit Graph

13 Commits

Author SHA1 Message Date
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
Sean Sullivan
6c96a059dd Move pkg/kubectl/cmd/util and subdirs to staging 2019-07-29 13:08:41 -07:00
Sean Sullivan
70984d8385 Moves pkg/kubectl/util/i18n to staging 2019-07-25 23:09:34 -07:00
Tim Allclair
9ba6fe8810 refactors to kubernetes cp command 2019-07-22 13:25:13 -07:00
Sean Sullivan
67140f13fe Updated dependencies: BUILD/modules.txt 2019-07-18 15:43:26 -07:00
Peter Swica
123fa89f21 Moved pkg/kubectl/util/term, pkg/kubectl/util/templates, pkg/kubectl/util/interrupt, and pkg/kubectl/util/interrupt to staging 2019-06-20 15:50:16 -04:00
Maciej Szulik
7962231a80
Properly handle links in tar 2019-04-26 22:19:44 +02:00
Sascha Grunert
ba7aaa911d
Update dedent to latest release
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-01-17 08:30:07 +01: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
Maciej Szulik
61899e1654
Generated changes 2018-10-11 22:01:06 +02:00
Maciej Szulik
1d9617d8e1
Generated changes 2018-10-06 18:44:05 +02:00