|
15 | 15 | *
|
16 | 16 | */
|
17 | 17 |
|
18 |
| -import { experimental, logVerbosity, status as Status, Metadata, connectivityState, ChannelOptions } from "@grpc/grpc-js"; |
| 18 | +import { experimental, logVerbosity, status as Status, Metadata, connectivityState, ChannelOptions, ChannelCredentials } from "@grpc/grpc-js"; |
19 | 19 | import { validateXdsServerConfig, XdsServerConfig } from "./xds-bootstrap";
|
20 | 20 | import { getSingletonXdsClient, XdsClient, XdsClusterDropStats, XdsClusterLocalityStats } from "./xds-client";
|
21 | 21 | import { LocalityEndpoint } from "./load-balancer-priority";
|
@@ -253,13 +253,13 @@ class XdsClusterImplBalancer implements LoadBalancer {
|
253 | 253 | private clusterDropStats: XdsClusterDropStats | null = null;
|
254 | 254 | private xdsClient: XdsClient | null = null;
|
255 | 255 |
|
256 |
| - constructor(private readonly channelControlHelper: ChannelControlHelper, options: ChannelOptions) { |
| 256 | + constructor(private readonly channelControlHelper: ChannelControlHelper, credentials: ChannelCredentials, options: ChannelOptions) { |
257 | 257 | this.childBalancer = new ChildLoadBalancerHandler(createChildChannelControlHelper(channelControlHelper, {
|
258 |
| - createSubchannel: (subchannelAddress, subchannelArgs) => { |
| 258 | + createSubchannel: (subchannelAddress, subchannelArgs, credentialsOverride) => { |
259 | 259 | if (!this.xdsClient || !this.latestConfig || !this.lastestEndpointList) {
|
260 | 260 | throw new Error('xds_cluster_impl: invalid state: createSubchannel called with xdsClient or latestConfig not populated');
|
261 | 261 | }
|
262 |
| - const wrapperChild = channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs); |
| 262 | + const wrapperChild = channelControlHelper.createSubchannel(subchannelAddress, subchannelArgs, credentialsOverride); |
263 | 263 | let locality: Locality__Output | null = null;
|
264 | 264 | for (const endpoint of this.lastestEndpointList) {
|
265 | 265 | if (endpointHasAddress(endpoint, subchannelAddress)) {
|
@@ -290,7 +290,7 @@ class XdsClusterImplBalancer implements LoadBalancer {
|
290 | 290 | channelControlHelper.updateState(connectivityState, picker);
|
291 | 291 | }
|
292 | 292 | }
|
293 |
| - }), options); |
| 293 | + }), credentials, options); |
294 | 294 | }
|
295 | 295 | updateAddressList(endpointList: Endpoint[], lbConfig: TypedLoadBalancingConfig, attributes: { [key: string]: unknown; }): void {
|
296 | 296 | if (!(lbConfig instanceof XdsClusterImplLoadBalancingConfig)) {
|
|
0 commit comments