mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #79352 from aojea/e2eIpv6Prestop
add IPv6 support to the e2e PreStop test
This commit is contained in:
commit
68aaf8b91f
@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
@ -78,6 +79,8 @@ func testPreStop(c clientset.Interface, ns string) {
|
|||||||
podOut, err := c.CoreV1().Pods(ns).Get(podDescr.Name, metav1.GetOptions{})
|
podOut, err := c.CoreV1().Pods(ns).Get(podDescr.Name, metav1.GetOptions{})
|
||||||
framework.ExpectNoError(err, "getting pod info")
|
framework.ExpectNoError(err, "getting pod info")
|
||||||
|
|
||||||
|
podURL := net.JoinHostPort(podOut.Status.PodIP, "8080")
|
||||||
|
|
||||||
preStopDescr := &v1.Pod{
|
preStopDescr := &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "tester",
|
Name: "tester",
|
||||||
@ -92,7 +95,7 @@ func testPreStop(c clientset.Interface, ns string) {
|
|||||||
PreStop: &v1.Handler{
|
PreStop: &v1.Handler{
|
||||||
Exec: &v1.ExecAction{
|
Exec: &v1.ExecAction{
|
||||||
Command: []string{
|
Command: []string{
|
||||||
"wget", "-O-", "--post-data=" + val, fmt.Sprintf("http://%s:8080/write", podOut.Status.PodIP),
|
"wget", "-O-", "--post-data=" + val, fmt.Sprintf("http://%s/write", podURL),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user