add e2e test for dual-stack secondary service IPs
Dual stack services can have two ClusterIPs, we already have tests that exercise the connectivity from different scenarios to the first ClusterIP of the service. This PR adds a new functionality to the e2e network utils to enable DualStack services, and replicate the same tests but using the secondary ClusterIP, so we cover the connectivity to both cluster IPs.
This commit is contained in:
@@ -20,11 +20,12 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
netutil "k8s.io/utils/net"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
netutil "k8s.io/utils/net"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
"github.com/onsi/gomega"
|
||||
|
||||
@@ -249,6 +250,17 @@ func GetInternalIP(node *v1.Node) (string, error) {
|
||||
return host, nil
|
||||
}
|
||||
|
||||
// FirstAddressByTypeAndFamily returns the first address of the given type and family of each node.
|
||||
func FirstAddressByTypeAndFamily(nodelist *v1.NodeList, addrType v1.NodeAddressType, family v1.IPFamily) string {
|
||||
for _, n := range nodelist.Items {
|
||||
addresses := GetAddressesByTypeAndFamily(&n, addrType, family)
|
||||
if len(addresses) > 0 {
|
||||
return addresses[0]
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetAddressesByTypeAndFamily returns a list of addresses of the given addressType for the given node
|
||||
// and filtered by IPFamily
|
||||
func GetAddressesByTypeAndFamily(node *v1.Node, addressType v1.NodeAddressType, family v1.IPFamily) (ips []string) {
|
||||
|
||||
Reference in New Issue
Block a user