Skip to content

Commit

Permalink
Changed flag name from invalidData to dataInvalid
Browse files Browse the repository at this point in the history
  • Loading branch information
voidzcy committed Nov 19, 2019
1 parent dc14fb6 commit 388e977
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xds/src/main/java/io/grpc/xds/XdsClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ private void handleEdsResponse(DiscoveryResponse edsResponse) {
return;
}

boolean invalidData = false;
boolean dataInvalid = false;
// Full endpoint information update received in this EDS response to be cached.
Map<String, EndpointUpdate> endpointUpdates = new HashMap<>();
// EndpointUpdate data to be pushed to each watcher.
Expand All @@ -543,27 +543,27 @@ private void handleEdsResponse(DiscoveryResponse edsResponse) {
EndpointUpdate.Builder updateBuilder = EndpointUpdate.newBuilder();
updateBuilder.setClusterName(clusterName);
if (assignment.getEndpointsCount() == 0) {
invalidData = true;
dataInvalid = true;
break;
}
// The policy.disable_overprovisioning field must be set to true.
if (!assignment.getPolicy().getDisableOverprovisioning()) {
invalidData = true;
dataInvalid = true;
break;
}
for (io.envoyproxy.envoy.api.v2.endpoint.LocalityLbEndpoints localityLbEndpoints
: assignment.getEndpointsList()) {
// The lb_endpoints field for LbEndpoint must contain at least one entry.
if (localityLbEndpoints.getLbEndpointsCount() == 0) {
invalidData = true;
dataInvalid = true;
break validateData;
}
// The endpoint field of each lb_endpoints must be set.
// Inside of it: the address field must be set.
for (io.envoyproxy.envoy.api.v2.endpoint.LbEndpoint lbEndpoint
: localityLbEndpoints.getLbEndpointsList()) {
if (!lbEndpoint.hasEndpoint() || !lbEndpoint.getEndpoint().hasAddress()) {
invalidData = true;
dataInvalid = true;
break validateData;
}
}
Expand All @@ -584,7 +584,7 @@ private void handleEdsResponse(DiscoveryResponse edsResponse) {
desiredEndpointUpdates.put(clusterName, update);
}
}
if (invalidData) {
if (dataInvalid) {
adsStream.sendNackRequest(ADS_TYPE_URL_EDS, adsStream.edsResourceNames,
edsResponse.getNonce(),
"ClusterLoadAssignment message contains invalid information for gRPC's usage");
Expand Down

0 comments on commit 388e977

Please sign in to comment.