mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 22:33:34 +00:00
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:
commit
122a459dcb
@ -24,6 +24,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"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
|
// 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.
|
// 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)
|
klog.V(6).InfoS("Function IsUnixDomainSocket starts", "filePath", filePath)
|
||||||
// As detailed in https://github.com/kubernetes/kubernetes/issues/104584 we cannot rely
|
// 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
|
// on the Unix Domain socket working on the very first try, hence the potential need to
|
||||||
|
@ -22,6 +22,8 @@ package util
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"net"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
Loading…
Reference in New Issue
Block a user