Ensure the mount point is propagated
mount with `rshared`, the host path should be shared. mount with `rslave`, the host pash should be shared or slave. Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
This commit is contained in:
@@ -40,6 +40,7 @@ type OS interface {
|
||||
WriteFile(filename string, data []byte, perm os.FileMode) error
|
||||
Mount(source string, target string, fstype string, flags uintptr, data string) error
|
||||
Unmount(target string, flags int) error
|
||||
GetMounts() ([]*mount.Info, error)
|
||||
}
|
||||
|
||||
// RealOS is used to dispatch the real system level operations.
|
||||
@@ -114,3 +115,8 @@ func (RealOS) Unmount(target string, flags int) error {
|
||||
}
|
||||
return unix.Unmount(target, flags)
|
||||
}
|
||||
|
||||
// GetMounts retrieves a list of mounts for the current running process.
|
||||
func (RealOS) GetMounts() ([]*mount.Info, error) {
|
||||
return mount.GetMounts()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user