diff --git a/pkg/volume/util/hostutil/hostutil_windows.go b/pkg/volume/util/hostutil/hostutil_windows.go index 27bc8b212b9..b702d1e7e9b 100644 --- a/pkg/volume/util/hostutil/hostutil_windows.go +++ b/pkg/volume/util/hostutil/hostutil_windows.go @@ -29,7 +29,6 @@ import ( "golang.org/x/sys/windows" "k8s.io/klog/v2" - "k8s.io/kubernetes/pkg/util/filesystem" "k8s.io/mount-utils" utilpath "k8s.io/utils/path" ) @@ -103,14 +102,6 @@ func isSystemCannotAccessErr(err error) bool { func (hu *(HostUtil)) GetFileType(pathname string) (FileType, error) { 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 }