Merge pull request #84258 from oomichi/move-TranslateIPv4ToIPv6

Move TranslateIPv4ToIPv6() to e2e scheduling test
This commit is contained in:
Kubernetes Prow Robot
2019-10-24 16:56:31 -07:00
committed by GitHub
3 changed files with 13 additions and 12 deletions

View File

@@ -40,7 +40,6 @@ import (
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
imageutils "k8s.io/kubernetes/test/utils/image"
k8utilnet "k8s.io/utils/net"
)
const (
@@ -76,16 +75,6 @@ const (
// NetexecImageName is the image name for agnhost.
var NetexecImageName = imageutils.GetE2EImage(imageutils.Agnhost)
// TranslateIPv4ToIPv6 maps an IPv4 address into a valid IPv6 address
// 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 TestContext.IPFamily == "ipv6" && !k8utilnet.IsIPv6String(ip) && ip != "" {
ip = "0::ffff:" + ip
}
return ip
}
// NewNetworkingTestConfig creates and sets up a new test config helper.
func NewNetworkingTestConfig(f *Framework) *NetworkingTestConfig {
config := &NetworkingTestConfig{f: f, Namespace: f.Namespace.Name, HostNetwork: true}