func (j *TestJig) CreateLoadBalancerService(timeout time.Duration, tweak func(svc *v1.Service)) (*v1.Service, error) {
	ginkgo.By("creating a service " + j.Namespace + "/" + j.Name + " with type=LoadBalancer")
	svc := j.newServiceTemplate(v1.ProtocolTCP, 80)
	svc.Spec.Type = v1.ServiceTypeLoadBalancer
	// We need to turn affinity off for our LB distribution tests
	svc.Spec.SessionAffinity = v1.ServiceAffinityNone
	if tweak != nil {
		tweak(svc)
	}
	_, err := j.Client.CoreV1().Services(j.Namespace).Create(context.TODO(), svc, metav1.CreateOptions{})
	if err != nil {
		return nil, fmt.Errorf("failed to create LoadBalancer Service %q: %v", svc.Name, err)
	}

	ginkgo.By("waiting for loadbalancer for service " + j.Namespace + "/" + j.Name)
	return j.WaitForLoadBalancer(timeout)
}
// CreateLoadBalancerService creates a loadbalancer service and waits
// for it to acquire an ingress IP.
CreateLoadBalancerService creates a loadbalancer service and waits
for it to acquire an ingress IP.
// CreateLoadBalancerService creates a loadbalancer service and waits // for it to acquire an ingress IP .
func (j *TestJig) CreateLoadBalancerService(timeout time.Duration, tweak func(svc *v1.Service)) (*v1.Service, error) {
	ginkgo.By("creating a service " + j.Namespace + "/" + j.Name + " with type=LoadBalancer")
	svc := j.newServiceTemplate(v1.ProtocolTCP, 80)
	svc.Spec.Type = v1.ServiceTypeLoadBalancer
	svc.Spec.SessionAffinity = v1.ServiceAffinityNone
	if tweak != nil {
		tweak(svc)
	}
	_, err := j.Client.CoreV1().Services(j.Namespace).Create(context.TODO(), svc, metav1.CreateOptions{})
	if err != nil {
		return nil, fmt.Errorf("failed to create LoadBalancer Service %q: %v", svc.Name, err)
	}
	ginkgo.By("waiting for loadbalancer for service " + j.Namespace + "/" + j.Name)
	return j.WaitForLoadBalancer(timeout)
}
func ( j * TestJig ) CreateLoadBalancerService ( timeout time . Duration , tweak func ( svc * v1 . Service ) ) ( * v1 . Service , error ) { ginkgo . By ( " " + j . Namespace + " " + j . Name + " " ) svc := j . newServiceTemplate ( v1 . ProtocolTCP , 80 ) svc . Spec . Type = v1 . ServiceTypeLoadBalancer svc . Spec . SessionAffinity = v1 . ServiceAffinityNone if tweak != nil { tweak ( svc ) } _ , err := j . Client . CoreV1 ( ) . Services ( j . Namespace ) . Create ( context . TODO ( ) , svc , metav1 . CreateOptions { } ) if err != nil { return nil , fmt . Errorf ( " " , svc . Name , err ) } ginkgo . By ( " " + j . Namespace + " " + j . Name ) return j . WaitForLoadBalancer ( timeout ) }
CreateLoadBalancerService creates a loadbalancer service and waits
for it to acquire an ingress IP.
CreateLoadBalancerService creates a loadbalancer service and waits for it to acquire an ingress IP .
// We need to turn affinity off for our LB distribution tests