Skip to content

Commit 03ad78f

Browse files
committed
removed todo in addNodesAndProxies
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 54cc58f commit 03ad78f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/commands/network.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,32 +1119,30 @@ export class NetworkCommand extends BaseCommand {
11191119
skip: (): boolean => !this.remoteConfigManager.isLoaded(),
11201120
task: async (ctx): Promise<void> => {
11211121
const {
1122-
config: {namespace, nodeAliases},
1122+
config: {namespace},
11231123
} = ctx;
1124-
const cluster = this.remoteConfigManager.currentCluster;
11251124

1126-
// TODO: @Lenin, we can update this to use config.consensusNodes and provide the correct cluster per node
11271125
await this.remoteConfigManager.modify(async remoteConfig => {
1128-
for (const nodeAlias of nodeAliases) {
1129-
remoteConfig.components.add(
1130-
nodeAlias,
1126+
for (const consensusNode of ctx.config.consensusNodes) {
1127+
remoteConfig.components.edit(
1128+
consensusNode.name,
11311129
new ConsensusNodeComponent(
1132-
nodeAlias,
1133-
cluster,
1130+
consensusNode.name,
1131+
consensusNode.cluster,
11341132
namespace.name,
11351133
ConsensusNodeStates.INITIALIZED,
1136-
Templates.nodeIdFromNodeAlias(nodeAlias),
1134+
consensusNode.nodeId,
11371135
),
11381136
);
11391137

11401138
remoteConfig.components.add(
1141-
`envoy-proxy-${nodeAlias}`,
1142-
new EnvoyProxyComponent(`envoy-proxy-${nodeAlias}`, cluster, namespace.name),
1139+
`envoy-proxy-${consensusNode.name}`,
1140+
new EnvoyProxyComponent(`envoy-proxy-${consensusNode.name}`, consensusNode.cluster, namespace.name),
11431141
);
11441142

11451143
remoteConfig.components.add(
1146-
`haproxy-${nodeAlias}`,
1147-
new HaProxyComponent(`haproxy-${nodeAlias}`, cluster, namespace.name),
1144+
`haproxy-${consensusNode.name}`,
1145+
new HaProxyComponent(`haproxy-${consensusNode.name}`, consensusNode.cluster, namespace.name),
11481146
);
11491147
}
11501148
});

0 commit comments

Comments
 (0)