func (j *TestJig) WaitForLoadBalancer(timeout time.Duration) (*v1.Service, error) {
	framework.Logf("Waiting up to %v for service %q to have a LoadBalancer", timeout, j.Name)
	service, err := j.waitForCondition(timeout, "have a load balancer", func(svc *v1.Service) bool {
		return len(svc.Status.LoadBalancer.Ingress) > 0
	})
	if err != nil {
		return nil, err
	}

	for i, ing := range service.Status.LoadBalancer.Ingress {
		if ing.IP == "" && ing.Hostname == "" {
			return nil, fmt.Errorf("unexpected Status.LoadBalancer.Ingress[%d] for service: %#v", i, ing)
		}
	}

	return j.sanityCheckService(service, v1.ServiceTypeLoadBalancer)
}
// WaitForLoadBalancer waits the given service to have a LoadBalancer, or returns an error after the given timeout
WaitForLoadBalancer waits the given service to have a LoadBalancer, or returns an error after the given timeout
// WaitForLoadBalancer waits the given service to have a LoadBalancer or returns an error after the given timeout
func (j *TestJig) WaitForLoadBalancer(timeout time.Duration) (*v1.Service, error) {
	framework.Logf("Waiting up to %v for service %q to have a LoadBalancer", timeout, j.Name)
	service, err := j.waitForCondition(timeout, "have a load balancer", func(svc *v1.Service) bool {
		return len(svc.Status.LoadBalancer.Ingress) > 0
	})
	if err != nil {
		return nil, err
	}
	for i, ing := range service.Status.LoadBalancer.Ingress {
		if ing.IP == "" && ing.Hostname == "" {
			return nil, fmt.Errorf("unexpected Status.LoadBalancer.Ingress[%d] for service: %#v", i, ing)
		}
	}
	return j.sanityCheckService(service, v1.ServiceTypeLoadBalancer)
}
func ( j * TestJig ) WaitForLoadBalancer ( timeout time . Duration ) ( * v1 . Service , error ) { framework . Logf ( " " , timeout , j . Name ) service , err := j . waitForCondition ( timeout , " " , func ( svc * v1 . Service ) bool { return len ( svc . Status . LoadBalancer . Ingress ) > 0 } ) if err != nil { return nil , err } for i , ing := range service . Status . LoadBalancer . Ingress { if ing . IP == " " && ing . Hostname == " " { return nil , fmt . Errorf ( " " , i , ing ) } } return j . sanityCheckService ( service , v1 . ServiceTypeLoadBalancer ) }
WaitForLoadBalancer waits the given service to have a LoadBalancer, or returns an error after the given timeout
WaitForLoadBalancer waits the given service to have a LoadBalancer or returns an error after the given timeout