Commit 6b827928 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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. @freehan
parents 0b048906 0d500921
......@@ -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]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment