mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Return unwrapped ErrNotExist when EvalSymlink returns PathError
By default filepath.EvalSymlink returns PathError. When a file is not found, we should unwrap it and return ErrNotExist as this is what this function expects. Similar to the comment at: https://github.com/kubernetes/kubernetes/pull/109217#discussion_r896272206
This commit is contained in:
parent
08ef11029f
commit
44bea35804
@ -732,6 +732,9 @@ func (mounter *Mounter) IsMountPoint(file string) (bool, error) {
|
|||||||
// Resolve any symlinks in file, kernel would do the same and use the resolved path in /proc/mounts.
|
// Resolve any symlinks in file, kernel would do the same and use the resolved path in /proc/mounts.
|
||||||
resolvedFile, err := filepath.EvalSymlinks(file)
|
resolvedFile, err := filepath.EvalSymlinks(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if errors.Is(isMntErr, fs.ErrNotExist) {
|
||||||
|
return false, fs.ErrNotExist
|
||||||
|
}
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user