Fix e2e network dns_configmap test

Updates predicate to check for a length >=2 to avoid
the index out of bounds panic.

Signed-off-by: Edwin Xie <exie@vmware.com>
Co-authored-by: Tyler Schultz <tschultz@vmware.com>
This commit is contained in:
Edwin Xie 2022-08-04 20:52:26 +00:00 committed by Tyler Schultz
parent eefcf6aa80
commit f167b9f4ab

View File

@ -298,7 +298,7 @@ func (t *dnsExternalNameTest) run(isIPv6 bool) {
t.checkDNSRecordFrom( t.checkDNSRecordFrom(
fmt.Sprintf("%s.%s.svc.%s", serviceNameLocal, f.Namespace.Name, framework.TestContext.ClusterDNSDomain), fmt.Sprintf("%s.%s.svc.%s", serviceNameLocal, f.Namespace.Name, framework.TestContext.ClusterDNSDomain),
func(actual []string) bool { func(actual []string) bool {
return len(actual) >= 1 && actual[0] == fooHostname+"." && actual[1] == "2001:db8::29" return len(actual) >= 2 && actual[0] == fooHostname+"." && actual[1] == "2001:db8::29"
}, },
"cluster-dns-ipv6", "cluster-dns-ipv6",
moreForeverTestTimeout) moreForeverTestTimeout)