func (j *TestJig) CreateExternalNameService(tweak func(svc *v1.Service)) (*v1.Service, error) {
	svc := &v1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Namespace: j.Namespace,
			Name:      j.Name,
			Labels:    j.Labels,
		},
		Spec: v1.ServiceSpec{
			Selector:     j.Labels,
			ExternalName: "foo.example.com",
			Type:         v1.ServiceTypeExternalName,
		},
	}
	if tweak != nil {
		tweak(svc)
	}
	result, err := j.Client.CoreV1().Services(j.Namespace).Create(context.TODO(), svc, metav1.CreateOptions{})
	if err != nil {
		return nil, fmt.Errorf("failed to create ExternalName Service %q: %v", svc.Name, err)
	}
	return j.sanityCheckService(result, svc.Spec.Type)
}
// CreateExternalNameService creates a new ExternalName type Service based on the j's defaults.
// Callers can provide a function to tweak the Service object before it is created.
CreateExternalNameService creates a new ExternalName type Service based on the j's defaults.
Callers can provide a function to tweak the Service object before it is created.
// CreateExternalNameService creates a new ExternalName type Service based on the j ' s defaults . // Callers can provide a function to tweak the Service object before it is created .
func (j *TestJig) CreateExternalNameService(tweak func(svc *v1.Service)) (*v1.Service, error) {
	svc := &v1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Namespace: j.Namespace,
			Name:      j.Name,
			Labels:    j.Labels,
		},
		Spec: v1.ServiceSpec{
			Selector:     j.Labels,
			ExternalName: "foo.example.com",
			Type:         v1.ServiceTypeExternalName,
		},
	}
	if tweak != nil {
		tweak(svc)
	}
	result, err := j.Client.CoreV1().Services(j.Namespace).Create(context.TODO(), svc, metav1.CreateOptions{})
	if err != nil {
		return nil, fmt.Errorf("failed to create ExternalName Service %q: %v", svc.Name, err)
	}
	return j.sanityCheckService(result, svc.Spec.Type)
}
func ( j * TestJig ) CreateExternalNameService ( tweak func ( svc * v1 . Service ) ) ( * v1 . Service , error ) { svc := & v1 . Service { ObjectMeta : metav1 . ObjectMeta { Namespace : j . Namespace , Name : j . Name , Labels : j . Labels , } , Spec : v1 . ServiceSpec { Selector : j . Labels , ExternalName : " " , Type : v1 . ServiceTypeExternalName , } , } if tweak != nil { tweak ( svc ) } result , err := j . Client . CoreV1 ( ) . Services ( j . Namespace ) . Create ( context . TODO ( ) , svc , metav1 . CreateOptions { } ) if err != nil { return nil , fmt . Errorf ( " " , svc . Name , err ) } return j . sanityCheckService ( result , svc . Spec . Type ) }
CreateExternalNameService creates a new ExternalName type Service based on the j's defaults.
CreateExternalNameService creates a new ExternalName type Service based on the j ' s defaults .