Skip to content

Commit c6b6fcc

Browse files
committed
progressing node add
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 35da9f9 commit c6b6fcc

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/commands/node.mjs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,22 +1549,24 @@ export class NodeCommand extends BaseCommand {
15491549
{
15501550
title: 'Identify existing network nodes',
15511551
task: async (ctx, task) => {
1552-
ctx.config.serviceMap = await self.accountManager.getNodeServiceMap(
1553-
ctx.config.namespace)
1554-
for (/** @type {NetworkNodeServices} **/ const networkNodeServices of ctx.config.serviceMap.values()) {
1555-
ctx.config.existingNodeIds.push(networkNodeServices.nodeName)
1552+
const config = /** @type {NodeAddConfigClass} **/ ctx.config
1553+
config.serviceMap = await self.accountManager.getNodeServiceMap(
1554+
config.namespace)
1555+
for (/** @type {NetworkNodeServices} **/ const networkNodeServices of config.serviceMap.values()) {
1556+
config.existingNodeIds.push(networkNodeServices.nodeName)
15561557
}
15571558

1558-
return self.taskCheckNetworkNodePods(ctx, task, ctx.config.existingNodeIds)
1559+
return self.taskCheckNetworkNodePods(ctx, task, config.existingNodeIds)
15591560
}
15601561
},
15611562
{
15621563
title: 'Determine new node account number',
15631564
task: (ctx, task) => {
1565+
const config = /** @type {NodeAddConfigClass} **/ ctx.config
15641566
const values = { hedera: { nodes: [] } }
15651567
let maxNum = 0
15661568

1567-
for (/** @type {NetworkNodeServices} **/ const networkNodeServices of ctx.config.serviceMap.values()) {
1569+
for (/** @type {NetworkNodeServices} **/ const networkNodeServices of config.serviceMap.values()) {
15681570
values.hedera.nodes.push({
15691571
accountId: networkNodeServices.accountId,
15701572
name: networkNodeServices.nodeName
@@ -1577,14 +1579,14 @@ export class NodeCommand extends BaseCommand {
15771579
ctx.maxNum = maxNum
15781580
ctx.newNode = {
15791581
accountId: `${constants.HEDERA_NODE_ACCOUNT_ID_START.realm}.${constants.HEDERA_NODE_ACCOUNT_ID_START.shard}.${++maxNum}`,
1580-
name: ctx.config.nodeId
1582+
name: config.nodeId
15811583
}
15821584
}
15831585
},
15841586
{
15851587
title: 'Generate Gossip key',
15861588
task: async (ctx, parentTask) => {
1587-
const config = ctx.config
1589+
const config = /** @type {NodeAddConfigClass} **/ ctx.config
15881590
const subTasks = self._nodeGossipKeysTaskList(config.keyFormat, [config.nodeId], config.keysDir, config.curDate, config.allNodeIds)
15891591
// set up the sub-tasks
15901592
return parentTask.newListr(subTasks, {
@@ -1600,7 +1602,7 @@ export class NodeCommand extends BaseCommand {
16001602
{
16011603
title: 'Generate gRPC TLS key',
16021604
task: async (ctx, parentTask) => {
1603-
const config = ctx.config
1605+
const config = /** @type {NodeAddConfigClass} **/ ctx.config
16041606
const subTasks = self._nodeTlsKeyTaskList([config.nodeId], config.keysDir, config.curDate)
16051607
// set up the sub-tasks
16061608
return parentTask.newListr(subTasks, {
@@ -1888,6 +1890,10 @@ export class NodeCommand extends BaseCommand {
18881890
task:
18891891
async (ctx, task) => {
18901892
const config = /** @type {NodeAddConfigClass} **/ ctx.config
1893+
config.serviceMap = await self.accountManager.getNodeServiceMap(
1894+
config.namespace)
1895+
const newPodName = config.serviceMap.get(config.nodeId).nodePodName
1896+
config.podNames = [...config.podNames, newPodName]
18911897
return self.fetchLocalOrReleasedPlatformSoftware(config.allNodeIds, config.podNames, config.releaseTag, task, config.localBuildPath)
18921898
}
18931899
},
@@ -1945,8 +1951,6 @@ export class NodeCommand extends BaseCommand {
19451951
task: async (ctx, task) => {
19461952
const config = /** @type {NodeAddConfigClass} **/ ctx.config
19471953
const subTasks = []
1948-
await sleep(60000) // wait 60 seconds for the kubelet syncFrequency = 1m to sync the updated configMap for config.txt
1949-
// TODO does the application.properties with the bump version working? that might also be a configMap mount, I don't think it is readonly though.
19501954
self.startNodes(config.podNames, config.allNodeIds, subTasks)
19511955

19521956
// set up the sub-tasks

0 commit comments

Comments
 (0)