mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
[hostutil_windows] Remove unix workaround
This commit is contained in:
parent
2a32b21372
commit
237aadab89
@ -29,7 +29,6 @@ import (
|
|||||||
|
|
||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
"k8s.io/kubernetes/pkg/util/filesystem"
|
|
||||||
"k8s.io/mount-utils"
|
"k8s.io/mount-utils"
|
||||||
utilpath "k8s.io/utils/path"
|
utilpath "k8s.io/utils/path"
|
||||||
)
|
)
|
||||||
@ -103,14 +102,6 @@ func isSystemCannotAccessErr(err error) bool {
|
|||||||
func (hu *(HostUtil)) GetFileType(pathname string) (FileType, error) {
|
func (hu *(HostUtil)) GetFileType(pathname string) (FileType, error) {
|
||||||
filetype, err := getFileType(pathname)
|
filetype, err := getFileType(pathname)
|
||||||
|
|
||||||
// os.Stat will return a 1920 error (windows.ERROR_CANT_ACCESS_FILE) if we use it on a Unix Socket
|
|
||||||
// on Windows. In this case, we need to use a different method to check if it's a Unix Socket.
|
|
||||||
if err == errUnknownFileType || isSystemCannotAccessErr(err) {
|
|
||||||
if isSocket, errSocket := filesystem.IsUnixDomainSocket(pathname); errSocket == nil && isSocket {
|
|
||||||
return FileTypeSocket, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return filetype, err
|
return filetype, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user