Skip to content

Commit ac9ad67

Browse files
committed
grpc-js-xds: xds_cluster_manager: pass along updates to existing children
1 parent 83b6e60 commit ac9ad67

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/grpc-js-xds/src/load-balancer-xds-cluster-manager.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,14 @@ class XdsClusterManager implements LoadBalancer {
227227
this.children.get(name)!.destroy();
228228
this.children.delete(name);
229229
}
230-
// Add new children that were not in the previous config
230+
// Update all children, and add any new ones
231231
for (const [name, childConfig] of configChildren.entries()) {
232-
if (!this.children.has(name)) {
233-
const newChild = new this.XdsClusterManagerChildImpl(this, name);
234-
newChild.updateAddressList(endpointList, childConfig, attributes);
235-
this.children.set(name, newChild);
232+
let child = this.children.get(name);
233+
if (!child) {
234+
child = new this.XdsClusterManagerChildImpl(this, name);
235+
this.children.set(name, child);
236236
}
237+
child.updateAddressList(endpointList, childConfig, attributes);
237238
}
238239
this.updatesPaused = false;
239240
this.updateState();

0 commit comments

Comments
 (0)