1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/vendor/github.com/moby/buildkit/snapshot/localmounter_windows.go
Tonis Tiigi 6fcb36ff14 vendor: add buildkit dependency
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-10 10:05:19 -07:00

26 lines
375 B
Go

package snapshot
import (
"os"
"github.com/containerd/containerd/mount"
)
func (lm *localMounter) Unmount() error {
lm.mu.Lock()
defer lm.mu.Unlock()
if lm.target != "" {
if err := mount.Unmount(lm.target, 0); err != nil {
return err
}
os.RemoveAll(lm.target)
lm.target = ""
}
if lm.mountable != nil {
return lm.mountable.Release()
}
return nil
}