|
41 | 41 | import io.grpc.xds.client.XdsClient; |
42 | 42 | import io.grpc.xds.client.XdsClient.ResourceWatcher; |
43 | 43 | import io.grpc.xds.client.XdsResourceType; |
| 44 | +import java.net.SocketAddress; |
44 | 45 | import java.net.URI; |
45 | 46 | import java.net.URISyntaxException; |
46 | 47 | import java.util.ArrayList; |
@@ -83,7 +84,7 @@ private enum TrackedWatcherTypeEnum { |
83 | 84 |
|
84 | 85 | private static final int MAX_CLUSTER_RECURSION_DEPTH = 16; // Specified by gRFC A37 |
85 | 86 |
|
86 | | - static boolean enableLogicalDns = false; |
| 87 | + static boolean enableLogicalDns = true; |
87 | 88 |
|
88 | 89 | private final String listenerName; |
89 | 90 | private final XdsClient xdsClient; |
@@ -394,10 +395,13 @@ private static StatusOr<XdsEndpointResource.EdsUpdate> dnsToEdsUpdate( |
394 | 395 | return StatusOr.fromStatus(dnsData.getStatus()); |
395 | 396 | } |
396 | 397 |
|
397 | | - List<Endpoints.LbEndpoint> endpoints = new ArrayList<>(); |
| 398 | + List<SocketAddress> addresses = new ArrayList<>(); |
398 | 399 | for (EquivalentAddressGroup eag : dnsData.getValue()) { |
399 | | - endpoints.add(Endpoints.LbEndpoint.create(eag, 1, true, dnsHostName, ImmutableMap.of())); |
| 400 | + addresses.addAll(eag.getAddresses()); |
400 | 401 | } |
| 402 | + EquivalentAddressGroup eag = new EquivalentAddressGroup(addresses); |
| 403 | + List<Endpoints.LbEndpoint> endpoints = ImmutableList.of( |
| 404 | + Endpoints.LbEndpoint.create(eag, 1, true, dnsHostName, ImmutableMap.of())); |
401 | 405 | LocalityLbEndpoints lbEndpoints = |
402 | 406 | LocalityLbEndpoints.create(endpoints, 1, 0, ImmutableMap.of()); |
403 | 407 | return StatusOr.fromValue(new XdsEndpointResource.EdsUpdate( |
|
0 commit comments