mount: move the MakePrivate to pkg/mount
The logic is unrelated to graphdriver. Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
parent
74b38deaa9
commit
aaada9057d
1 changed files with 18 additions and 0 deletions
18
mount/sharedsubtree_linux.go
Normal file
18
mount/sharedsubtree_linux.go
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
// +build linux
|
||||||
|
|
||||||
|
package mount
|
||||||
|
|
||||||
|
func MakePrivate(mountPoint string) error {
|
||||||
|
mounted, err := Mounted(mountPoint)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if !mounted {
|
||||||
|
if err := Mount(mountPoint, mountPoint, "none", "bind,rw"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ForceMount("", mountPoint, "none", "private")
|
||||||
|
}
|
Loading…
Reference in a new issue