mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
test/e2e/scheduling:improve code
This commit is contained in:
parent
7061dddf26
commit
e358e75681
@ -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++
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user