diff options
author | Matthew Heon <matthew.heon@pm.me> | 2021-02-17 14:09:28 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-02-17 14:57:06 -0500 |
commit | a9d548bf771ae8011ed0d9862184980599dde9a1 (patch) | |
tree | c2d0764e897e75640da9f447360fbfb94dabae39 /libpod/container_internal.go | |
parent | d48f4a0e1f3d24fb4f98351b5bdd31daa34c0fb6 (diff) | |
download | podman-a9d548bf771ae8011ed0d9862184980599dde9a1.tar.gz podman-a9d548bf771ae8011ed0d9862184980599dde9a1.tar.bz2 podman-a9d548bf771ae8011ed0d9862184980599dde9a1.zip |
Change source path resolution for volume copy-up
Instead of using the container's mountpoint as the base of the
chroot and indexing from there by the volume directory, instead
use the full path of what we want to copy as the base of the
chroot and copy everything in it. This resolves the bug, ends up
being a bit simpler code-wise (no string concatenation, as we
already have the full path calculated for other checks), and
seems more understandable than trying to resolve things on the
destination side of the copy-up.
Fixes #9354
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index ca0e082ff..e22f3fcfa 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1644,7 +1644,7 @@ func (c *Container) mountNamedVolume(v *ContainerNamedVolume, mountpoint string) getOptions := copier.GetOptions{ KeepDirectoryNames: false, } - errChan <- copier.Get(mountpoint, "", getOptions, []string{v.Dest + "/."}, writer) + errChan <- copier.Get(srcDir, "", getOptions, []string{"/."}, writer) }() // Copy, volume side: stream what we've written to the pipe, into |