func (j *TestJig) ChangeServiceType(newType v1.ServiceType, timeout time.Duration) error {
	ingressIP := ""
	svc, err := j.UpdateService(func(s *v1.Service) {
		for _, ing := range s.Status.LoadBalancer.Ingress {
			if ing.IP != "" {
				ingressIP = ing.IP
			}
		}
		s.Spec.Type = newType
		s.Spec.Ports[0].NodePort = 0
	})
	if err != nil {
		return err
	}
	if ingressIP != "" {
		_, err = j.WaitForLoadBalancerDestroy(ingressIP, int(svc.Spec.Ports[0].Port), timeout)
	}
	return err
}
// ChangeServiceType updates the given service's ServiceType to the given newType.
ChangeServiceType updates the given service's ServiceType to the given newType.
// ChangeServiceType updates the given service ' s ServiceType to the given newType .
func (j *TestJig) ChangeServiceType(newType v1.ServiceType, timeout time.Duration) error {
	ingressIP := ""
	svc, err := j.UpdateService(func(s *v1.Service) {
		for _, ing := range s.Status.LoadBalancer.Ingress {
			if ing.IP != "" {
				ingressIP = ing.IP
			}
		}
		s.Spec.Type = newType
		s.Spec.Ports[0].NodePort = 0
	})
	if err != nil {
		return err
	}
	if ingressIP != "" {
		_, err = j.WaitForLoadBalancerDestroy(ingressIP, int(svc.Spec.Ports[0].Port), timeout)
	}
	return err
}
func ( j * TestJig ) ChangeServiceType ( newType v1 . ServiceType , timeout time . Duration ) error { ingressIP := " " svc , err := j . UpdateService ( func ( s * v1 . Service ) { for _ , ing := range s . Status . LoadBalancer . Ingress { if ing . IP != " " { ingressIP = ing . IP } } s . Spec . Type = newType s . Spec . Ports [ 0 ] . NodePort = 0 } ) if err != nil { return err } if ingressIP != " " { _ , err = j . WaitForLoadBalancerDestroy ( ingressIP , int ( svc . Spec . Ports [ 0 ] . Port ) , timeout ) } return err }
ChangeServiceType updates the given service's ServiceType to the given newType.
ChangeServiceType updates the given service ' s ServiceType to the given newType .