From ae4ccc91b2812460ec8b839c7b51850626cb999a Mon Sep 17 00:00:00 2001 From: aojeagarcia Date: Sat, 9 Mar 2019 13:24:13 +0100 Subject: [PATCH] Add IPv6 support to the Downward e2e API test Current regex used in the Downward e2e API tests is matching only IPv4 addresses, consequently those tests fails with IPv6 clusters. This patch modifies the regex to match ipv4 and ipv6 addresses. Ref: https://github.com/kubernetes/kubernetes/issues/70248 --- test/e2e/common/downward_api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/common/downward_api.go b/test/e2e/common/downward_api.go index bd7ac61205c..0055af21423 100644 --- a/test/e2e/common/downward_api.go +++ b/test/e2e/common/downward_api.go @@ -78,7 +78,7 @@ var _ = Describe("[sig-node] Downward API", func() { expectations := []string{ fmt.Sprintf("POD_NAME=%v", podName), fmt.Sprintf("POD_NAMESPACE=%v", f.Namespace.Name), - "POD_IP=(?:\\d+)\\.(?:\\d+)\\.(?:\\d+)\\.(?:\\d+)", + "POD_IP=(?:\\d+\\.\\d+\\.\\d+\\.\\d+|[a-fA-F0-9:]+)", } testDownwardAPI(f, podName, env, expectations) @@ -105,7 +105,7 @@ var _ = Describe("[sig-node] Downward API", func() { } expectations := []string{ - "HOST_IP=(?:\\d+)\\.(?:\\d+)\\.(?:\\d+)\\.(?:\\d+)", + "HOST_IP=(?:\\d+\\.\\d+\\.\\d+\\.\\d+|[a-fA-F0-9:]+)", } testDownwardAPI(f, podName, env, expectations)