summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorflouthoc <flouthoc.git@gmail.com>2021-08-30 11:52:15 +0530
committerAditya Rajan <arajan@redhat.com>2021-08-30 19:49:26 +0530
commitec1f350ee5a3776f6fac6e96e1277d0ab36d130a (patch)
treecc164fe140719648be064a223236976bc8f9eb70 /libpod
parenta2acd04447a66027dc02a210d2961fcde6868985 (diff)
downloadpodman-ec1f350ee5a3776f6fac6e96e1277d0ab36d130a.tar.gz
podman-ec1f350ee5a3776f6fac6e96e1277d0ab36d130a.tar.bz2
podman-ec1f350ee5a3776f6fac6e96e1277d0ab36d130a.zip
container: resolve workdir after all the mounts happen.
There are use-cases where users would want to use overlay-mounts as workdir. For such cases workdir should be resolved after all the mounts are completed during the container init process. Signed-off-by: Aditya Rajan <arajan@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal.go5
-rw-r--r--libpod/container_internal_linux.go5
2 files changed, 5 insertions, 5 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 6717ada59..9082b136a 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1072,6 +1072,11 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {
return err
}
+ // Make sure the workdir exists while initializing container
+ if err := c.resolveWorkDir(); err != nil {
+ return err
+ }
+
// Save the OCI newSpec to disk
if err := c.saveSpec(newSpec); err != nil {
return err
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 8b73c82de..b624f44ac 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -176,11 +176,6 @@ func (c *Container) prepare() error {
return err
}
- // Make sure the workdir exists
- if err := c.resolveWorkDir(); err != nil {
- return err
- }
-
return nil
}