mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-26 19:35:10 +00:00
unittests: Fixes unit tests for Windows (part 10)
Currently, there are some unit tests that are failing on Windows due to various reasons: - Different "File not found" error messages on Windows. - Files need to be closed on Windows before removing them. - The default RootHnsEndpointName (root-hnsendpoint-name) flag value is 'cbr0' - On Windows, Unix Domain sockets are not checked in the same way in golang, which is why hostutils_windows.go checks for it differently. GetFileType will return an error in this case. We need to check for it, and see if it's actually a Unix Domain Socket.
This commit is contained in:
@@ -106,7 +106,7 @@ func (hu *(HostUtil)) GetFileType(pathname string) (FileType, error) {
|
||||
|
||||
// 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 isSystemCannotAccessErr(err) {
|
||||
if err == errUnknownFileType || isSystemCannotAccessErr(err) {
|
||||
if isSocket, errSocket := filesystem.IsUnixDomainSocket(pathname); errSocket == nil && isSocket {
|
||||
return FileTypeSocket, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user