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
This commit is contained in:
aojeagarcia 2019-03-09 13:24:13 +01:00 committed by Antonio Ojea
parent 0b4275b6c7
commit ae4ccc91b2
No known key found for this signature in database
GPG Key ID: E4833AA228D4E824

View File

@ -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)