File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
xds/src/main/java/io/grpc/xds Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -157,14 +157,19 @@ public Status acceptResolvedAddresses(ResolvedAddresses resolvedAddresses) {
157157 return fail (noneFoundError );
158158 }
159159
160- // The LB policy config is provided in service_config.proto/JSON format.
161- NameResolver .ConfigOrError configOrError =
162- GracefulSwitchLoadBalancer .parseLoadBalancingPolicyConfig (
163- Arrays .asList (clusterConfig .getClusterResource ().lbPolicyConfig ()), lbRegistry );
164- if (configOrError .getError () != null ) {
165- // Should be impossible, because XdsClusterResource validated this
166- return fail (Status .INTERNAL .withDescription (
167- errorPrefix () + "Unable to parse the LB config: " + configOrError .getError ()));
160+ NameResolver .ConfigOrError configOrError ;
161+ if (clusterConfig .getChildren () instanceof EndpointConfig ) {
162+ // The LB policy config is provided in service_config.proto/JSON format.
163+ configOrError =
164+ GracefulSwitchLoadBalancer .parseLoadBalancingPolicyConfig (
165+ Arrays .asList (clusterConfig .getClusterResource ().lbPolicyConfig ()), lbRegistry );
166+ if (configOrError .getError () != null ) {
167+ // Should be impossible, because XdsClusterResource validated this
168+ return fail (Status .INTERNAL .withDescription (
169+ errorPrefix () + "Unable to parse the LB config: " + configOrError .getError ()));
170+ }
171+ } else {
172+
168173 }
169174
170175 ClusterResolverConfig config = new ClusterResolverConfig (
You can’t perform that action at this time.
0 commit comments