mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
tests: Makes UDP testing command more Windows friendly
By default, cmd is used to execute commands in Windows containers, but it has some issues executing the command (no output): echo 'hostName' | nc -w 1 -u <targetIP> <targetPort> But it has no issues running (output is correct): echo hostName | nc -w 1 -u <targetIP> <targetPort> This causes the test "should function for node-pod communication: udp" to fail when using Windows Containers.
This commit is contained in:
parent
f364b65ed6
commit
72be895238
@ -292,7 +292,7 @@ func (config *NetworkingTestConfig) DialFromNode(protocol, targetIP string, targ
|
||||
if protocol == "udp" {
|
||||
// TODO: It would be enough to pass 1s+epsilon to timeout, but unfortunately
|
||||
// busybox timeout doesn't support non-integer values.
|
||||
cmd = fmt.Sprintf("echo 'hostName' | nc -w 1 -u %s %d", targetIP, targetPort)
|
||||
cmd = fmt.Sprintf("echo hostName | nc -w 1 -u %s %d", targetIP, targetPort)
|
||||
} else {
|
||||
ipPort := net.JoinHostPort(targetIP, strconv.Itoa(targetPort))
|
||||
// The current versions of curl included in CentOS and RHEL distros
|
||||
|
Loading…
Reference in New Issue
Block a user