Merge pull request #95019 from aojea/sliceFalke

Fix e2e endpoint slice flake test
This commit is contained in:
Kubernetes Prow Robot 2020-12-14 18:33:48 -08:00 committed by GitHub
commit 52bf6641f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -521,7 +521,11 @@ func hasMatchingEndpointSlices(cs clientset.Interface, ns, svcName string, numEn
for _, endpointSlice := range esList.Items { for _, endpointSlice := range esList.Items {
actualNumEndpoints += len(endpointSlice.Endpoints) actualNumEndpoints += len(endpointSlice.Endpoints)
} }
if actualNumEndpoints != numEndpoints { // In some cases the EndpointSlice controller will create more
// EndpointSlices than necessary resulting in some duplication. This is
// valid and tests should only fail here if less EndpointSlices than
// expected are added.
if actualNumEndpoints < numEndpoints {
framework.Logf("EndpointSlices for %s/%s Service have %d/%d endpoints", ns, svcName, actualNumEndpoints, numEndpoints) framework.Logf("EndpointSlices for %s/%s Service have %d/%d endpoints", ns, svcName, actualNumEndpoints, numEndpoints)
return esList.Items, false return esList.Items, false
} }