func (j *TestJig) GetEndpointNodeNames() (sets.String, error) {
	endpoints, err := j.Client.CoreV1().Endpoints(j.Namespace).Get(context.TODO(), j.Name, metav1.GetOptions{})
	if err != nil {
		return nil, fmt.Errorf("get endpoints for service %s/%s failed (%s)", j.Namespace, j.Name, err)
	}
	if len(endpoints.Subsets) == 0 {
		return nil, fmt.Errorf("endpoint has no subsets, cannot determine node addresses")
	}
	epNodes := sets.NewString()
	for _, ss := range endpoints.Subsets {
		for _, e := range ss.Addresses {
			if e.NodeName != nil {
				epNodes.Insert(*e.NodeName)
			}
		}
	}
	return epNodes, nil
}
// GetEndpointNodeNames returns a string set of node names on which the
// endpoints of the given Service are running.
GetEndpointNodeNames returns a string set of node names on which the
endpoints of the given Service are running.
// GetEndpointNodeNames returns a string set of node names on which the // endpoints of the given Service are running .
func (j *TestJig) GetEndpointNodeNames() (sets.String, error) {
	endpoints, err := j.Client.CoreV1().Endpoints(j.Namespace).Get(context.TODO(), j.Name, metav1.GetOptions{})
	if err != nil {
		return nil, fmt.Errorf("get endpoints for service %s/%s failed (%s)", j.Namespace, j.Name, err)
	}
	if len(endpoints.Subsets) == 0 {
		return nil, fmt.Errorf("endpoint has no subsets, cannot determine node addresses")
	}
	epNodes := sets.NewString()
	for _, ss := range endpoints.Subsets {
		for _, e := range ss.Addresses {
			if e.NodeName != nil {
				epNodes.Insert(*e.NodeName)
			}
		}
	}
	return epNodes, nil
}
func ( j * TestJig ) GetEndpointNodeNames ( ) ( sets . String , error ) { endpoints , err := j . Client . CoreV1 ( ) . Endpoints ( j . Namespace ) . Get ( context . TODO ( ) , j . Name , metav1 . GetOptions { } ) if err != nil { return nil , fmt . Errorf ( " " , j . Namespace , j . Name , err ) } if len ( endpoints . Subsets ) == 0 { return nil , fmt . Errorf ( " " ) } epNodes := sets . NewString ( ) for _ , ss := range endpoints . Subsets { for _ , e := range ss . Addresses { if e . NodeName != nil { epNodes . Insert ( * e . NodeName ) } } } return epNodes , nil }
GetEndpointNodeNames returns a string set of node names on which the
endpoints of the given Service are running.
GetEndpointNodeNames returns a string set of node names on which the endpoints of the given Service are running .