Use mount.Target to specify subdirectory of rootfs mount
- Add Target to mount.Mount. - Add UnmountMounts to unmount a list of mounts in reverse order. - Add UnmountRecursive to unmount deepest mount first for a given target, using moby/sys/mountinfo. Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>
This commit is contained in:
@@ -130,7 +130,7 @@ func (b *Bundle) Delete() error {
|
||||
work, werr := os.Readlink(filepath.Join(b.Path, "work"))
|
||||
rootfs := filepath.Join(b.Path, "rootfs")
|
||||
if runtime.GOOS != "darwin" {
|
||||
if err := mount.UnmountAll(rootfs, 0); err != nil {
|
||||
if err := mount.UnmountRecursive(rootfs, 0); err != nil {
|
||||
return fmt.Errorf("unmount rootfs %s: %w", rootfs, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user