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:
Claudiu Belu
2024-01-20 00:40:46 +00:00
parent 909faa3a9b
commit b8df7e7684
7 changed files with 22 additions and 8 deletions

View File

@@ -42,6 +42,9 @@ func (o *Options) platformApplyDefaults(config *proxyconfigapi.KubeProxyConfigur
if config.Mode == "" {
config.Mode = proxyconfigapi.ProxyModeKernelspace
}
if config.Winkernel.RootHnsEndpointName == "" {
config.Winkernel.RootHnsEndpointName = "cbr0"
}
}
// platformSetup is called after setting up the ProxyServer, but before creating the