Merge pull request #117616 from claudiubelu/fix-kubelet-util-windows-ut

unit tests: Fixes kubelet util unit tests for Windows
This commit is contained in:
Kubernetes Prow Robot 2023-05-10 19:51:09 -07:00 committed by GitHub
commit 122a459dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import (
"fmt"
"net"
"net/url"
"os"
"path/filepath"
"strings"
"syscall"
@ -165,6 +166,11 @@ func IsUnixDomainSocket(filePath string) (bool, error) {
// does NOT work in 1809 if the socket file is created within a bind mounted directory by a container
// and the FSCTL is issued in the host by the kubelet.
// If the file does not exist, it cannot be a Unix domain socket.
if _, err := os.Stat(filePath); os.IsNotExist(err) {
return false, fmt.Errorf("File %s not found. Err: %v", filePath, err)
}
klog.V(6).InfoS("Function IsUnixDomainSocket starts", "filePath", filePath)
// As detailed in https://github.com/kubernetes/kubernetes/issues/104584 we cannot rely
// on the Unix Domain socket working on the very first try, hence the potential need to

View File

@ -22,6 +22,8 @@ package util
import (
"fmt"
"math/rand"
"net"
"os"
"reflect"
"runtime"
"sync"