spiegel_podman/cmd/podman/containers
Valentin Rothberg a090301bbb podman cp: support copying on tmpfs mounts
Traditionally, the path resolution for containers has been resolved on
the *host*; relative to the container's mount point or relative to
specified bind mounts or volumes.

While this works nicely for non-running containers, it poses a problem
for running ones.  In that case, certain kinds of mounts (e.g., tmpfs)
will not resolve correctly.  A tmpfs is held in memory and hence cannot
be resolved relatively to the container's mount point.  A copy operation
will succeed but the data will not show up inside the container.

To support these kinds of mounts, we need to join the *running*
container's mount namespace (and PID namespace) when copying.

Note that this change implies moving the copy and stat logic into
`libpod` since we need to keep the container locked to avoid race
conditions.  The immediate benefit is that all logic is now inside
`libpod`; the code isn't scattered anymore.

Further note that Docker does not support copying to tmpfs mounts.

Tests have been extended to cover *both* path resolutions for running
and created containers.  New tests have been added to exercise the
tmpfs-mount case.

For the record: Some tests could be improved by using `start -a` instead
of a start-exec sequence.  Unfortunately, `start -a` is flaky in the CI
which forced me to use the more expensive start-exec option.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-04 15:43:12 +01:00
..
attach.go bump go module to v3 2021-02-22 09:03:51 +01:00
checkpoint.go bump go module to v3 2021-02-22 09:03:51 +01:00
cleanup.go bump go module to v3 2021-02-22 09:03:51 +01:00
commit.go bump go module to v3 2021-02-22 09:03:51 +01:00
container.go bump go module to v3 2021-02-22 09:03:51 +01:00
cp.go podman cp: support copying on tmpfs mounts 2021-03-04 15:43:12 +01:00
create.go Enable no_hosts from containers.conf 2021-02-26 06:37:48 -05:00
diff.go bump go module to v3 2021-02-22 09:03:51 +01:00
exec.go bump go module to v3 2021-02-22 09:03:51 +01:00
exists.go bump go module to v3 2021-02-22 09:03:51 +01:00
export.go bump go module to v3 2021-02-22 09:03:51 +01:00
init.go bump go module to v3 2021-02-22 09:03:51 +01:00
inspect.go bump go module to v3 2021-02-22 09:03:51 +01:00
kill.go bump go module to v3 2021-02-22 09:03:51 +01:00
list.go bump go module to v3 2021-02-22 09:03:51 +01:00
logs.go bump go module to v3 2021-02-22 09:03:51 +01:00
mount.go bump go module to v3 2021-02-22 09:03:51 +01:00
pause.go bump go module to v3 2021-02-22 09:03:51 +01:00
port.go bump go module to v3 2021-02-22 09:03:51 +01:00
prune.go bump go module to v3 2021-02-22 09:03:51 +01:00
ps.go bump go module to v3 2021-02-22 09:03:51 +01:00
rename.go bump go module to v3 2021-02-22 09:03:51 +01:00
restart.go bump go module to v3 2021-02-22 09:03:51 +01:00
restore.go bump go module to v3 2021-02-22 09:03:51 +01:00
rm.go bump go module to v3 2021-02-22 09:03:51 +01:00
run.go bump go module to v3 2021-02-22 09:03:51 +01:00
runlabel.go bump go module to v3 2021-02-22 09:03:51 +01:00
start.go bump go module to v3 2021-02-22 09:03:51 +01:00
stats.go bump go module to v3 2021-02-22 09:03:51 +01:00
stop.go bump go module to v3 2021-02-22 09:03:51 +01:00
top.go bump go module to v3 2021-02-22 09:03:51 +01:00
unmount.go bump go module to v3 2021-02-22 09:03:51 +01:00
unpause.go bump go module to v3 2021-02-22 09:03:51 +01:00
utils.go Podman V2 birth 2020-04-16 15:53:58 -05:00
wait.go bump go module to v3 2021-02-22 09:03:51 +01:00