Skip to content

Commit fe19844

Browse files
authored
Merge pull request #1908 from murgatroid99/grpc-js-xds_log_bootstrap
grpc-js-xds: Log loaded bootstrap info in xDS client (1.4.x)
2 parents a08e43d + 4229b76 commit fe19844

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/grpc-js-xds/src/xds-client.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ export class XdsClient {
340340
if (this.hasShutdown) {
341341
return;
342342
}
343+
trace('Loaded bootstrap info: ' + JSON.stringify(bootstrapInfo, undefined, 2));
343344
if (bootstrapInfo.xdsServers[0].serverFeatures.indexOf('xds_v3') >= 0) {
344345
this.apiVersion = XdsApiVersion.V3;
345346
} else {
@@ -370,6 +371,13 @@ export class XdsClient {
370371
...nodeV3,
371372
client_features: ['envoy.lrs.supports_send_all_clusters'],
372373
};
374+
if (this.apiVersion === XdsApiVersion.V2) {
375+
trace('ADS Node: ' + JSON.stringify(this.adsNodeV2, undefined, 2));
376+
trace('LRS Node: ' + JSON.stringify(this.lrsNodeV2, undefined, 2));
377+
} else {
378+
trace('ADS Node: ' + JSON.stringify(this.adsNodeV3, undefined, 2));
379+
trace('LRS Node: ' + JSON.stringify(this.lrsNodeV3, undefined, 2));
380+
}
373381
const credentialsConfigs = bootstrapInfo.xdsServers[0].channelCreds;
374382
let channelCreds: ChannelCredentials | null = null;
375383
for (const config of credentialsConfigs) {

0 commit comments

Comments
 (0)