Skip to content

Commit

Permalink
removed todo in addNodesAndProxies
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon committed Feb 12, 2025
1 parent 54cc58f commit 03ad78f
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/commands/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1119,32 +1119,30 @@ export class NetworkCommand extends BaseCommand {
skip: (): boolean => !this.remoteConfigManager.isLoaded(),
task: async (ctx): Promise<void> => {
const {
config: {namespace, nodeAliases},
config: {namespace},
} = ctx;
const cluster = this.remoteConfigManager.currentCluster;

// TODO: @Lenin, we can update this to use config.consensusNodes and provide the correct cluster per node
await this.remoteConfigManager.modify(async remoteConfig => {
for (const nodeAlias of nodeAliases) {
remoteConfig.components.add(
nodeAlias,
for (const consensusNode of ctx.config.consensusNodes) {
remoteConfig.components.edit(
consensusNode.name,
new ConsensusNodeComponent(
nodeAlias,
cluster,
consensusNode.name,
consensusNode.cluster,
namespace.name,
ConsensusNodeStates.INITIALIZED,
Templates.nodeIdFromNodeAlias(nodeAlias),
consensusNode.nodeId,
),
);

remoteConfig.components.add(
`envoy-proxy-${nodeAlias}`,
new EnvoyProxyComponent(`envoy-proxy-${nodeAlias}`, cluster, namespace.name),
`envoy-proxy-${consensusNode.name}`,
new EnvoyProxyComponent(`envoy-proxy-${consensusNode.name}`, consensusNode.cluster, namespace.name),
);

remoteConfig.components.add(
`haproxy-${nodeAlias}`,
new HaProxyComponent(`haproxy-${nodeAlias}`, cluster, namespace.name),
`haproxy-${consensusNode.name}`,
new HaProxyComponent(`haproxy-${consensusNode.name}`, consensusNode.cluster, namespace.name),
);
}
});
Expand Down

0 comments on commit 03ad78f

Please sign in to comment.