mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #89918 from tanjunchen/improve-code
test/e2e/scheduling : improve code
This commit is contained in:
commit
157b2aa820
@ -288,11 +288,11 @@ func VerifyJobNCompletions(f *framework.Framework, completions int32) {
|
|||||||
framework.Logf("Got the following pods for job cuda-add: %v", createdPodNames)
|
framework.Logf("Got the following pods for job cuda-add: %v", createdPodNames)
|
||||||
|
|
||||||
successes := int32(0)
|
successes := int32(0)
|
||||||
|
regex := regexp.MustCompile("PASSED")
|
||||||
for _, podName := range createdPodNames {
|
for _, podName := range createdPodNames {
|
||||||
f.PodClient().WaitForFinish(podName, 5*time.Minute)
|
f.PodClient().WaitForFinish(podName, 5*time.Minute)
|
||||||
logs, err := e2epod.GetPodLogs(f.ClientSet, ns, podName, "vector-addition")
|
logs, err := e2epod.GetPodLogs(f.ClientSet, ns, podName, "vector-addition")
|
||||||
framework.ExpectNoError(err, "Should be able to get logs for pod %v", podName)
|
framework.ExpectNoError(err, "Should be able to get logs for pod %v", podName)
|
||||||
regex := regexp.MustCompile("PASSED")
|
|
||||||
if regex.MatchString(logs) {
|
if regex.MatchString(logs) {
|
||||||
successes++
|
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
|
// 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
|
// if the ip is IPv4 and the cluster IPFamily is IPv6, otherwise returns the same ip
|
||||||
func translateIPv4ToIPv6(ip string) string {
|
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
|
ip = "0::ffff:" + ip
|
||||||
}
|
}
|
||||||
return ip
|
return ip
|
||||||
|
Loading…
Reference in New Issue
Block a user