@@ -1119,32 +1119,30 @@ export class NetworkCommand extends BaseCommand {
1119
1119
skip : ( ) : boolean => ! this . remoteConfigManager . isLoaded ( ) ,
1120
1120
task : async ( ctx ) : Promise < void > => {
1121
1121
const {
1122
- config : { namespace, nodeAliases } ,
1122
+ config : { namespace} ,
1123
1123
} = ctx ;
1124
- const cluster = this . remoteConfigManager . currentCluster ;
1125
1124
1126
- // TODO: @Lenin , we can update this to use config.consensusNodes and provide the correct cluster per node
1127
1125
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 ,
1131
1129
new ConsensusNodeComponent (
1132
- nodeAlias ,
1133
- cluster ,
1130
+ consensusNode . name ,
1131
+ consensusNode . cluster ,
1134
1132
namespace . name ,
1135
1133
ConsensusNodeStates . INITIALIZED ,
1136
- Templates . nodeIdFromNodeAlias ( nodeAlias ) ,
1134
+ consensusNode . nodeId ,
1137
1135
) ,
1138
1136
) ;
1139
1137
1140
1138
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 ) ,
1143
1141
) ;
1144
1142
1145
1143
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 ) ,
1148
1146
) ;
1149
1147
}
1150
1148
} ) ;
0 commit comments