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
pull/6/head
Kubernetes Submit Queue 2016-10-05 00:07:11 -07:00 committed by GitHub
commit 6b82792880
1 changed files with 6 additions and 3 deletions

View File

@ -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]
}