mirror of https://github.com/k3s-io/k3s
Merge pull request #62304 from msau42/remove-err-check
Automatic merge from submit-queue (batch tested with PRs 61608, 62304). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove isNotDir error check **What this PR does / why we need it**: This check was supposed to handle the "subpath file" scenario, but: 1. It's wrong (should have been !) 2. It's not needed anymore. `IsLikelyNotMountPoint` was fixed to handle file mounts via https://github.com/kubernetes/kubernetes/pull/58433 **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/8/head
commit
06c5afe275
|
@ -23,7 +23,6 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
type FileType string
|
||||
|
@ -233,13 +232,6 @@ func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, e
|
|||
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.
|
||||
// It should return ErrNotExist when the directory does not exist.
|
||||
// This method uses the List() of all mountpoints
|
||||
|
@ -255,7 +247,7 @@ func IsNotMountPoint(mounter Interface, file string) (bool, error) {
|
|||
notMnt = true
|
||||
notMntErr = nil
|
||||
}
|
||||
if notMntErr != nil && isNotDirErr(notMntErr) {
|
||||
if notMntErr != nil {
|
||||
return notMnt, notMntErr
|
||||
}
|
||||
// identified as mountpoint, so return this fact
|
||||
|
|
Loading…
Reference in New Issue