func hasMatchingEndpoints(cs clientset.Interface, ns, svcName string, numIPs, numSubsets int) (*v1.Endpoints, bool) {
	endpoints, err := cs.CoreV1().Endpoints(ns).Get(context.TODO(), svcName, metav1.GetOptions{})
	if err != nil {
		if apierrors.IsNotFound(err) {
			framework.Logf("Endpoints for %s/%s Service not found", ns, svcName)
			return nil, false
		}
		framework.ExpectNoError(err, "Error fetching Endpoints for %s/%s Service", ns, svcName)
	}
	if len(endpoints.Subsets) != numSubsets {
		framework.Logf("Endpoints for %s/%s Service with %d/%d Subsets", ns, svcName, len(endpoints.Subsets), numSubsets)
		return nil, false
	}

	actualNumIPs := 0
	for _, endpointSubset := range endpoints.Subsets {
		actualNumIPs += len(endpointSubset.Addresses) + len(endpointSubset.NotReadyAddresses)
	}
	if actualNumIPs != numIPs {
		framework.Logf("Endpoints for %s/%s Service with %d/%d IPs", ns, svcName, actualNumIPs, numIPs)
		return nil, false
	}

	return endpoints, true
}
// hasMatchingEndpoints returns any Endpoints that match the conditions along
// with a boolean indicating if all the conditions have been met.
hasMatchingEndpoints returns any Endpoints that match the conditions along
with a boolean indicating if all the conditions have been met.
// hasMatchingEndpoints returns any Endpoints that match the conditions along // with a boolean indicating if all the conditions have been met .
func hasMatchingEndpoints(cs clientset.Interface, ns, svcName string, numIPs, numSubsets int) (*v1.Endpoints, bool) {
	endpoints, err := cs.CoreV1().Endpoints(ns).Get(context.TODO(), svcName, metav1.GetOptions{})
	if err != nil {
		if apierrors.IsNotFound(err) {
			framework.Logf("Endpoints for %s/%s Service not found", ns, svcName)
			return nil, false
		}
		framework.ExpectNoError(err, "Error fetching Endpoints for %s/%s Service", ns, svcName)
	}
	if len(endpoints.Subsets) != numSubsets {
		framework.Logf("Endpoints for %s/%s Service with %d/%d Subsets", ns, svcName, len(endpoints.Subsets), numSubsets)
		return nil, false
	}
	actualNumIPs := 0
	for _, endpointSubset := range endpoints.Subsets {
		actualNumIPs += len(endpointSubset.Addresses) + len(endpointSubset.NotReadyAddresses)
	}
	if actualNumIPs != numIPs {
		framework.Logf("Endpoints for %s/%s Service with %d/%d IPs", ns, svcName, actualNumIPs, numIPs)
		return nil, false
	}
	return endpoints, true
}
func hasMatchingEndpoints ( cs clientset . Interface , ns , svcName string , numIPs , numSubsets int ) ( * v1 . Endpoints , bool ) { endpoints , err := cs . CoreV1 ( ) . Endpoints ( ns ) . Get ( context . TODO ( ) , svcName , metav1 . GetOptions { } ) if err != nil { if apierrors . IsNotFound ( err ) { framework . Logf ( " " , ns , svcName ) return nil , false } framework . ExpectNoError ( err , " " , ns , svcName ) } if len ( endpoints . Subsets ) != numSubsets { framework . Logf ( " " , ns , svcName , len ( endpoints . Subsets ) , numSubsets ) return nil , false } actualNumIPs := 0 for _ , endpointSubset := range endpoints . Subsets { actualNumIPs += len ( endpointSubset . Addresses ) + len ( endpointSubset . NotReadyAddresses ) } if actualNumIPs != numIPs { framework . Logf ( " " , ns , svcName , actualNumIPs , numIPs ) return nil , false } return endpoints , true }
hasMatchingEndpoints returns any Endpoints that match the conditions along
with a boolean indicating if all the conditions have been met.
hasMatchingEndpoints returns any Endpoints that match the conditions along with a boolean indicating if all the conditions have been met .