Skip to content

Commit e358e75

Browse files
committed
test/e2e/scheduling:improve code
1 parent 7061ddd commit e358e75

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/e2e/scheduling/nvidia-gpus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ func VerifyJobNCompletions(f *framework.Framework, completions int32) {
288288
framework.Logf("Got the following pods for job cuda-add: %v", createdPodNames)
289289

290290
successes := int32(0)
291+
regex := regexp.MustCompile("PASSED")
291292
for _, podName := range createdPodNames {
292293
f.PodClient().WaitForFinish(podName, 5*time.Minute)
293294
logs, err := e2epod.GetPodLogs(f.ClientSet, ns, podName, "vector-addition")
294295
framework.ExpectNoError(err, "Should be able to get logs for pod %v", podName)
295-
regex := regexp.MustCompile("PASSED")
296296
if regex.MatchString(logs) {
297297
successes++
298298
}

test/e2e/scheduling/predicates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ func createHostPortPodOnNode(f *framework.Framework, podName, ns, hostIP string,
10391039
// adding the well known prefix "0::ffff:" https://tools.ietf.org/html/rfc2765
10401040
// if the ip is IPv4 and the cluster IPFamily is IPv6, otherwise returns the same ip
10411041
func translateIPv4ToIPv6(ip string) string {
1042-
if framework.TestContext.IPFamily == "ipv6" && !k8utilnet.IsIPv6String(ip) && ip != "" {
1042+
if framework.TestContext.IPFamily == "ipv6" && ip != "" && !k8utilnet.IsIPv6String(ip) {
10431043
ip = "0::ffff:" + ip
10441044
}
10451045
return ip

0 commit comments

Comments
 (0)