grpc-js-xds: Fix a typo in xds_cluster_impl parsing code

This commit is contained in:
Michael Lumish 2023-08-10 09:40:37 -07:00
parent 1137102cc7
commit 4f8db6907e
2 changed files with 10 additions and 2 deletions

View File

@ -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))) {

View File

@ -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}
}
]
}
}
}