Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions cmd/cloud-controller-manager-aws-tests-ext/e2e/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,21 @@ func getNLBMetaFromName(ctx context.Context, cs clientset.Interface, ns *v1.Name
Expect(lbDNS).NotTo(BeEmpty(), "Ingress Hostname must not be empty")
framework.Logf("Load balancer DNS: %s", lbDNS)

foundLB, err := getAWSLoadBalancerFromDNSName(ctx, elbc, lbDNS)
framework.ExpectNoError(err, "failed to find load balancer with DNS name %s", lbDNS)
Expect(foundLB).NotTo(BeNil(), "found load balancer is nil")
var foundLB *elbv2types.LoadBalancer
Eventually(ctx, func(ctx context.Context) error {
lb, err := getAWSLoadBalancerFromDNSName(ctx, elbc, lbDNS)
if err != nil {
framework.Logf("Failed to find load balancer with DNS %s: %v", lbDNS, err)
return err
}
if lb == nil {
framework.Logf("Load balancer %s not found yet", lbDNS)
return fmt.Errorf("load balancer not found yet")
}
foundLB = lb
return nil
}).WithTimeout(3*time.Minute).WithPolling(10*time.Second).Should(Succeed(),
"failed to find load balancer with DNS name %s", lbDNS)

return foundLB, lbDNS, nil
}
Expand Down