Fix subPath mountpint check
This commit is contained in:
parent
6a662180ac
commit
3f4217bc69
@ -48,9 +48,9 @@ func CleanupMountPoint(mountPath string, mounter Interface, extensiveMountPointC
|
|||||||
// if corruptedMnt is true, it means that the mountPath is a corrupted mountpoint, and the mount point check
|
// if corruptedMnt is true, it means that the mountPath is a corrupted mountpoint, and the mount point check
|
||||||
// will be skipped
|
// will be skipped
|
||||||
func doCleanupMountPoint(mountPath string, mounter Interface, extensiveMountPointCheck bool, corruptedMnt bool) error {
|
func doCleanupMountPoint(mountPath string, mounter Interface, extensiveMountPointCheck bool, corruptedMnt bool) error {
|
||||||
|
var notMnt bool
|
||||||
|
var err error
|
||||||
if !corruptedMnt {
|
if !corruptedMnt {
|
||||||
var notMnt bool
|
|
||||||
var err error
|
|
||||||
if extensiveMountPointCheck {
|
if extensiveMountPointCheck {
|
||||||
notMnt, err = IsNotMountPoint(mounter, mountPath)
|
notMnt, err = IsNotMountPoint(mounter, mountPath)
|
||||||
} else {
|
} else {
|
||||||
@ -73,9 +73,13 @@ func doCleanupMountPoint(mountPath string, mounter Interface, extensiveMountPoin
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
notMnt, mntErr := mounter.IsLikelyNotMountPoint(mountPath)
|
if extensiveMountPointCheck {
|
||||||
if mntErr != nil {
|
notMnt, err = IsNotMountPoint(mounter, mountPath)
|
||||||
return mntErr
|
} else {
|
||||||
|
notMnt, err = mounter.IsLikelyNotMountPoint(mountPath)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
if notMnt {
|
if notMnt {
|
||||||
klog.V(4).Infof("%q is unmounted, deleting the directory", mountPath)
|
klog.V(4).Infof("%q is unmounted, deleting the directory", mountPath)
|
||||||
|
Loading…
Reference in New Issue
Block a user