mirror of https://github.com/k3s-io/k3s
Allow unmounting bind-mounted directories.
For bind-mounted directories, the isNotMounted which calls IsLikelyNotMountPoint fails because the filesystem of the mounted location and the parent directory are the same. Addressing: unmounter.go:59] Warning: Path: /path/.../test-dir already unmountedpull/6/head
parent
6fdf0e4157
commit
6b7d4b7922
|
@ -51,13 +51,6 @@ func (f *flexVolumeUnmounter) TearDownAt(dir string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
notmnt, err := isNotMounted(f.mounter, dir)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if notmnt {
|
|
||||||
glog.Warningf("Warning: Path: %v already unmounted", dir)
|
|
||||||
} else {
|
|
||||||
call := f.plugin.NewDriverCall(unmountCmd)
|
call := f.plugin.NewDriverCall(unmountCmd)
|
||||||
call.Append(dir)
|
call.Append(dir)
|
||||||
_, err := call.Run()
|
_, err := call.Run()
|
||||||
|
@ -67,7 +60,6 @@ func (f *flexVolumeUnmounter) TearDownAt(dir string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Flexvolume driver may remove the directory. Ignore if it does.
|
// Flexvolume driver may remove the directory. Ignore if it does.
|
||||||
if pathExists, pathErr := util.PathExists(dir); pathErr != nil {
|
if pathExists, pathErr := util.PathExists(dir); pathErr != nil {
|
||||||
|
|
Loading…
Reference in New Issue