Merge pull request #45831 from MrHohn/esipp-panic-fix

Automatic merge from submit-queue

Check endpoint subsets length before asserting addresses.

Fix #45824.

Panics were caused by [WaitForEndpointOnNode()](3227f44157/test/e2e/framework/service_util.go (L329)). Check subsets length ahead to prevent panicing.

/assign @freehan

cc @wojtek-t 

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-05-16 00:32:58 -07:00 committed by GitHub
commit 3386425475

View File

@ -325,6 +325,10 @@ func (j *ServiceTestJig) WaitForEndpointOnNode(namespace, serviceName, nodeName
Logf("Get endpoints for service %s/%s failed (%s)", namespace, serviceName, err)
return false, nil
}
if len(endpoints.Subsets) == 0 {
Logf("Expect endpoints with subsets, got none.")
return false, nil
}
// TODO: Handle multiple endpoints
if len(endpoints.Subsets[0].Addresses) == 0 {
Logf("Expected Ready endpoints - found none")