mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
fix IsLikelyNotMountPoint func on Windows
This commit is contained in:
parent
e72d54981a
commit
5671cd81df
@ -145,7 +145,11 @@ func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) {
|
|||||||
}
|
}
|
||||||
// If current file is a symlink, then it is a mountpoint.
|
// If current file is a symlink, then it is a mountpoint.
|
||||||
if stat.Mode()&os.ModeSymlink != 0 {
|
if stat.Mode()&os.ModeSymlink != 0 {
|
||||||
return false, nil
|
target, err := os.Readlink(file)
|
||||||
|
if err != nil {
|
||||||
|
return true, fmt.Errorf("Readlink error: %v", err)
|
||||||
|
}
|
||||||
|
return !mounter.ExistsPath(target), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user