mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
fix e2e lb test on aws: call hostname instead of ip (#838)
Signed-off-by: Fabian Kammel <fk@edgeless.systems>
This commit is contained in:
parent
3daa0af9d3
commit
1caa40147a
@ -45,7 +45,7 @@ func TestLoadBalancer(t *testing.T) {
|
||||
|
||||
// Wait for external IP to be registered
|
||||
svc := testEventuallyExternalIPAvailable(t, k)
|
||||
loadBalancerIP := svc.Status.LoadBalancer.Ingress[0].IP
|
||||
loadBalancerIP := getIPOrHostname(t, svc)
|
||||
loadBalancerPort := svc.Spec.Ports[0].Port
|
||||
require.Equal(initialPort, loadBalancerPort)
|
||||
url := buildURL(t, loadBalancerIP, loadBalancerPort)
|
||||
@ -76,6 +76,14 @@ func TestLoadBalancer(t *testing.T) {
|
||||
assert.True(hasNUniqueStrings(allHostnames, numPods))
|
||||
}
|
||||
|
||||
func getIPOrHostname(t *testing.T, svc *coreV1.Service) string {
|
||||
t.Helper()
|
||||
if ip := svc.Status.LoadBalancer.Ingress[0].IP; ip != "" {
|
||||
return ip
|
||||
}
|
||||
return svc.Status.LoadBalancer.Ingress[0].Hostname
|
||||
}
|
||||
|
||||
func hasNUniqueStrings(elements []string, n int) bool {
|
||||
m := make(map[string]bool)
|
||||
for i := range elements {
|
||||
|
Loading…
Reference in New Issue
Block a user