mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
Remove isNotDir error check
This commit is contained in:
parent
a5c3c8d16c
commit
b79e7cabbc
@ -22,7 +22,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type FileType string
|
type FileType string
|
||||||
@ -232,13 +231,6 @@ func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, e
|
|||||||
return device, refCount, nil
|
return device, refCount, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func isNotDirErr(err error) bool {
|
|
||||||
if e, ok := err.(*os.PathError); ok && e.Err == syscall.ENOTDIR {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsNotMountPoint determines if a directory is a mountpoint.
|
// IsNotMountPoint determines if a directory is a mountpoint.
|
||||||
// It should return ErrNotExist when the directory does not exist.
|
// It should return ErrNotExist when the directory does not exist.
|
||||||
// This method uses the List() of all mountpoints
|
// This method uses the List() of all mountpoints
|
||||||
@ -254,7 +246,7 @@ func IsNotMountPoint(mounter Interface, file string) (bool, error) {
|
|||||||
notMnt = true
|
notMnt = true
|
||||||
notMntErr = nil
|
notMntErr = nil
|
||||||
}
|
}
|
||||||
if notMntErr != nil && isNotDirErr(notMntErr) {
|
if notMntErr != nil {
|
||||||
return notMnt, notMntErr
|
return notMnt, notMntErr
|
||||||
}
|
}
|
||||||
// identified as mountpoint, so return this fact
|
// identified as mountpoint, so return this fact
|
||||||
|
Loading…
Reference in New Issue
Block a user