Commit Graph

5 Commits (fd633d192f6c09c46368f4300af152216b1089fc)

Author SHA1 Message Date
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