func (j *TestJig) CheckServiceReachability(svc *v1.Service, pod *v1.Pod) error {
	svcType := svc.Spec.Type

	_, err := j.sanityCheckService(svc, svcType)
	if err != nil {
		return err
	}

	switch svcType {
	case v1.ServiceTypeClusterIP:
		return j.checkClusterIPServiceReachability(svc, pod)
	case v1.ServiceTypeNodePort:
		return j.checkNodePortServiceReachability(svc, pod)
	case v1.ServiceTypeExternalName:
		return j.checkExternalServiceReachability(svc, pod)
	default:
		return fmt.Errorf("unsupported service type \"%s\" to verify service reachability for \"%s\" service. This may due to diverse implementation of the service type", svcType, svc.Name)
	}
}
// CheckServiceReachability ensures that request are served by the services. Only supports Services with type ClusterIP, NodePort and ExternalName.
CheckServiceReachability ensures that request are served by the services. Only supports Services with type ClusterIP, NodePort and ExternalName.
// CheckServiceReachability ensures that request are served by the services . Only supports Services with type ClusterIP NodePort and ExternalName .
func (j *TestJig) CheckServiceReachability(svc *v1.Service, pod *v1.Pod) error {
	svcType := svc.Spec.Type
	_, err := j.sanityCheckService(svc, svcType)
	if err != nil {
		return err
	}
	switch svcType {
	case v1.ServiceTypeClusterIP:
		return j.checkClusterIPServiceReachability(svc, pod)
	case v1.ServiceTypeNodePort:
		return j.checkNodePortServiceReachability(svc, pod)
	case v1.ServiceTypeExternalName:
		return j.checkExternalServiceReachability(svc, pod)
	default:
		return fmt.Errorf("unsupported service type \"%s\" to verify service reachability for \"%s\" service. This may due to diverse implementation of the service type", svcType, svc.Name)
	}
}
func ( j * TestJig ) CheckServiceReachability ( svc * v1 . Service , pod * v1 . Pod ) error { svcType := svc . Spec . Type _ , err := j . sanityCheckService ( svc , svcType ) if err != nil { return err } switch svcType { case v1 . ServiceTypeClusterIP : return j . checkClusterIPServiceReachability ( svc , pod ) case v1 . ServiceTypeNodePort : return j . checkNodePortServiceReachability ( svc , pod ) case v1 . ServiceTypeExternalName : return j . checkExternalServiceReachability ( svc , pod ) default : return fmt . Errorf ( " \" \" \" \" " , svcType , svc . Name ) } }
CheckServiceReachability ensures that request are served by the services.
CheckServiceReachability ensures that request are served by the services .