Skip to content

Commit

Permalink
grpc-js-xds: xds_cluster_manager: pass along updates to existing chil…
Browse files Browse the repository at this point in the history
…dren
  • Loading branch information
murgatroid99 committed Nov 7, 2024
1 parent 83b6e60 commit ac9ad67
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/grpc-js-xds/src/load-balancer-xds-cluster-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,14 @@ class XdsClusterManager implements LoadBalancer {
this.children.get(name)!.destroy();
this.children.delete(name);
}
// Add new children that were not in the previous config
// Update all children, and add any new ones
for (const [name, childConfig] of configChildren.entries()) {
if (!this.children.has(name)) {
const newChild = new this.XdsClusterManagerChildImpl(this, name);
newChild.updateAddressList(endpointList, childConfig, attributes);
this.children.set(name, newChild);
let child = this.children.get(name);
if (!child) {
child = new this.XdsClusterManagerChildImpl(this, name);
this.children.set(name, child);
}
child.updateAddressList(endpointList, childConfig, attributes);
}
this.updatesPaused = false;
this.updateState();
Expand Down

0 comments on commit ac9ad67

Please sign in to comment.