Merge pull request #103071 from aojea/esipp_nodepor

wait for endpoints to be available
This commit is contained in:
Kubernetes Prow Robot 2021-06-22 18:28:38 -07:00 committed by GitHub
commit c48adbb3e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -304,6 +304,10 @@ func (j *TestJig) ListNodesWithEndpoint() ([]v1.Node, error) {
// 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) {
err := j.waitForAvailableEndpoint(ServiceEndpointsTimeout)
if err != nil {
return nil, err
}
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)