Skip to content

Commit

Permalink
Merge pull request #2541 from murgatroid99/grpc-js-xds_xds_cluster_im…
Browse files Browse the repository at this point in the history
…pl_config_fix

grpc-js-xds: Fix a typo in xds_cluster_impl parsing code
  • Loading branch information
murgatroid99 committed Aug 10, 2023
2 parents 1137102 + 4f8db69 commit b979cbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/grpc-js-xds/src/load-balancer-xds-cluster-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class XdsClusterImplLoadBalancingConfig implements TypedLoadBalancingConfig {
if ('eds_service_name' in obj && !(obj.eds_service_name === undefined || typeof obj.eds_service_name === 'string')) {
throw new Error('xds_cluster_impl config eds_service_name field must be a string if provided');
}
if ('max_concurrent_requests' in obj && (!obj.max_concurrent_requests === undefined || typeof obj.max_concurrent_requests === 'number')) {
if ('max_concurrent_requests' in obj && !(obj.max_concurrent_requests === undefined || typeof obj.max_concurrent_requests === 'number')) {
throw new Error('xds_cluster_impl config max_concurrent_requests must be a number if provided');
}
if (!('drop_categories' in obj && Array.isArray(obj.drop_categories))) {
Expand Down
10 changes: 9 additions & 1 deletion packages/grpc-js-xds/test/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@ export class FakeEdsCluster implements FakeCluster {
type: 'EDS',
eds_cluster_config: {eds_config: {ads: {}}, service_name: this.endpointName},
lb_policy: 'ROUND_ROBIN',
lrs_server: {self: {}}
lrs_server: {self: {}},
circuit_breakers: {
thresholds: [
{
priority: 'DEFAULT',
max_requests: {value: 1000}
}
]
}
}
}

Expand Down

0 comments on commit b979cbd

Please sign in to comment.