mirror of https://github.com/k3s-io/k3s
Merge pull request #34030 from MrHohn/e2e_service_fix
Automatic merge from submit-queue Improve source ip preservation test, fail the test instead of panic. From #31085. The source IP preserve test starts to be flake again. Sending out this PR to get rid of panicing and log the unexpected output for future investigation. @freehanpull/6/head
commit
6b82792880
|
@ -2347,7 +2347,10 @@ func execSourceipTest(f *framework.Framework, c *client.Client, ns, nodeName, se
|
|||
// the stdout return from RunHostCmd seems to come with "\n", so TrimSpace is needed
|
||||
// desired stdout in this format: client_address=x.x.x.x
|
||||
outputs := strings.Split(strings.TrimSpace(stdout), "=")
|
||||
sourceIp := outputs[1]
|
||||
|
||||
return execPodIp, sourceIp
|
||||
if len(outputs) != 2 {
|
||||
// fail the test if output format is unexpected
|
||||
framework.Failf("exec pod returned unexpected stdout format: [%v]\n", stdout)
|
||||
return execPodIp, ""
|
||||
}
|
||||
return execPodIp, outputs[1]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue