mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Use mount package to unmount container stuff
Really these mounts shouldn't be in the container pacakge. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
cc8f358c23
commit
d6558ad6a4
3 changed files with 2 additions and 34 deletions
|
@ -1,9 +0,0 @@
|
||||||
package container // import "github.com/docker/docker/container"
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golang.org/x/sys/unix"
|
|
||||||
)
|
|
||||||
|
|
||||||
func detachMounted(path string) error {
|
|
||||||
return unix.Unmount(path, unix.MNT_DETACH)
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
// +build freebsd
|
|
||||||
|
|
||||||
package container // import "github.com/docker/docker/container"
|
|
||||||
|
|
||||||
import (
|
|
||||||
"golang.org/x/sys/unix"
|
|
||||||
)
|
|
||||||
|
|
||||||
func detachMounted(path string) error {
|
|
||||||
// FreeBSD do not support the lazy unmount or MNT_DETACH feature.
|
|
||||||
// Therefore there are separate definitions for this.
|
|
||||||
return unix.Unmount(path, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SecretMounts returns the mounts for the secret path
|
|
||||||
func (container *Container) SecretMounts() []Mount {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmountSecrets unmounts the fs for secrets
|
|
||||||
func (container *Container) UnmountSecrets() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build linux freebsd
|
// +build !windows
|
||||||
|
|
||||||
package container // import "github.com/docker/docker/container"
|
package container // import "github.com/docker/docker/container"
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ func (container *Container) DetachAndUnmount(volumeEventLog func(name, action st
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, mountPath := range mountPaths {
|
for _, mountPath := range mountPaths {
|
||||||
if err := detachMounted(mountPath); err != nil {
|
if err := mount.Unmount(mountPath); err != nil {
|
||||||
logrus.Warnf("%s unmountVolumes: Failed to do lazy umount fo volume '%s': %v", container.ID, mountPath, err)
|
logrus.Warnf("%s unmountVolumes: Failed to do lazy umount fo volume '%s': %v", container.ID, mountPath, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue