Merge pull request #89918 from tanjunchen/improve-code

test/e2e/scheduling : improve code
This commit is contained in:
Kubernetes Prow Robot 2020-04-10 02:17:46 -07:00 committed by GitHub
commit 157b2aa820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -288,11 +288,11 @@ func VerifyJobNCompletions(f *framework.Framework, completions int32) {
framework.Logf("Got the following pods for job cuda-add: %v", createdPodNames)
successes := int32(0)
regex := regexp.MustCompile("PASSED")
for _, podName := range createdPodNames {
f.PodClient().WaitForFinish(podName, 5*time.Minute)
logs, err := e2epod.GetPodLogs(f.ClientSet, ns, podName, "vector-addition")
framework.ExpectNoError(err, "Should be able to get logs for pod %v", podName)
regex := regexp.MustCompile("PASSED")
if regex.MatchString(logs) {
successes++
}

View File

@ -1039,7 +1039,7 @@ func createHostPortPodOnNode(f *framework.Framework, podName, ns, hostIP string,
// adding the well known prefix "0::ffff:" https://tools.ietf.org/html/rfc2765
// if the ip is IPv4 and the cluster IPFamily is IPv6, otherwise returns the same ip
func translateIPv4ToIPv6(ip string) string {
if framework.TestContext.IPFamily == "ipv6" && !k8utilnet.IsIPv6String(ip) && ip != "" {
if framework.TestContext.IPFamily == "ipv6" && ip != "" && !k8utilnet.IsIPv6String(ip) {
ip = "0::ffff:" + ip
}
return ip