diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-26 16:59:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 16:59:57 +0100 |
commit | ad1e0bb77f56499ff22eeb8123aaab8e57a43c03 (patch) | |
tree | 2d51bab04ef8f221273d3f9d18aceb847daf5dc1 /pkg/domain/infra/abi/archive.go | |
parent | 41dd1eb8a22f6ac70dd48b53993c9d6ce4476eb4 (diff) | |
parent | 0f668aa0857815f388ef1bb880efa4b2e889edaf (diff) | |
download | podman-ad1e0bb77f56499ff22eeb8123aaab8e57a43c03.tar.gz podman-ad1e0bb77f56499ff22eeb8123aaab8e57a43c03.tar.bz2 podman-ad1e0bb77f56499ff22eeb8123aaab8e57a43c03.zip |
Merge pull request #9054 from vrothberg/fix-9040
make sure the workdir exists on container mount
Diffstat (limited to 'pkg/domain/infra/abi/archive.go')
-rw-r--r-- | pkg/domain/infra/abi/archive.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/archive.go b/pkg/domain/infra/abi/archive.go index 809813756..c64dfb02a 100644 --- a/pkg/domain/infra/abi/archive.go +++ b/pkg/domain/infra/abi/archive.go @@ -26,13 +26,18 @@ func (ic *ContainerEngine) ContainerCopyFromArchive(ctx context.Context, nameOrI return nil, err } + containerMountPoint, err := container.Mount() + if err != nil { + return nil, err + } + unmount := func() { if err := container.Unmount(false); err != nil { logrus.Errorf("Error unmounting container: %v", err) } } - _, resolvedRoot, resolvedContainerPath, err := ic.containerStat(container, containerPath) + _, resolvedRoot, resolvedContainerPath, err := ic.containerStat(container, containerMountPoint, containerPath) if err != nil { unmount() return nil, err @@ -71,6 +76,11 @@ func (ic *ContainerEngine) ContainerCopyToArchive(ctx context.Context, nameOrID return nil, err } + containerMountPoint, err := container.Mount() + if err != nil { + return nil, err + } + unmount := func() { if err := container.Unmount(false); err != nil { logrus.Errorf("Error unmounting container: %v", err) @@ -83,7 +93,7 @@ func (ic *ContainerEngine) ContainerCopyToArchive(ctx context.Context, nameOrID containerPath = "/." } - _, resolvedRoot, resolvedContainerPath, err := ic.containerStat(container, containerPath) + _, resolvedRoot, resolvedContainerPath, err := ic.containerStat(container, containerMountPoint, containerPath) if err != nil { unmount() return nil, err |