summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-10-20 13:15:04 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-10-26 13:51:45 +0200
commit2e3611d61f6fa3a9195e601027628a696aa77923 (patch)
treebe348f1e82dd3f2e4df3c5f9df2adf833eb96a7f
parent4d75df8be380cff4df082bd6fc2f05aa2c433723 (diff)
downloadpodman-2e3611d61f6fa3a9195e601027628a696aa77923.tar.gz
podman-2e3611d61f6fa3a9195e601027628a696aa77923.tar.bz2
podman-2e3611d61f6fa3a9195e601027628a696aa77923.zip
overlay root fs: create mount on runtime dir
Make sure to create the mounts for containers with an overlay root FS in the runtime dir (e.g., /run/user/1000/...) to guarantee that we can actually overlay mount on the specific path which is not the case for the graph root. [NO NEW TESTS NEEDED] since it is not a user-facing change. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
-rw-r--r--libpod/container_internal.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 994ffeec7..747fe6ceb 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1511,8 +1511,8 @@ func (c *Container) mountStorage() (_ string, deferredErr error) {
mountPoint := c.config.Rootfs
// Check if overlay has to be created on top of Rootfs
if c.config.RootfsOverlay {
- overlayDest := c.runtime.store.GraphRoot()
- contentDir, err := overlay.GenerateStructure(c.runtime.store.GraphRoot(), c.ID(), "rootfs", c.RootUID(), c.RootGID())
+ overlayDest := c.runtime.RunRoot()
+ contentDir, err := overlay.GenerateStructure(overlayDest, c.ID(), "rootfs", c.RootUID(), c.RootGID())
if err != nil {
return "", errors.Wrapf(err, "rootfs-overlay: failed to create TempDir in the %s directory", overlayDest)
}
@@ -1737,11 +1737,11 @@ func (c *Container) cleanupStorage() error {
// umount rootfs overlay if it was created
if c.config.RootfsOverlay {
- overlayBasePath := filepath.Dir(c.config.StaticDir)
- overlayBasePath = filepath.Join(overlayBasePath, "rootfs")
+ overlayBasePath := filepath.Dir(c.state.Mountpoint)
if err := overlay.Unmount(overlayBasePath); err != nil {
- // If the container can't remove content report the error
- logrus.Errorf("Failed to cleanup overlay mounts for %s: %v", c.ID(), err)
+ if cleanupErr != nil {
+ logrus.Errorf("Failed to cleanup overlay mounts for %s: %v", c.ID(), err)
+ }
cleanupErr = err
}
}