Skip to content

Commit 524737a

Browse files
committed
remove TODOs
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent c9e5de0 commit 524737a

File tree

4 files changed

+19
-60
lines changed

4 files changed

+19
-60
lines changed

src/commands/network.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ export class NetworkCommand extends BaseCommand {
3939

4040
static get DEPLOY_FLAGS_LIST () {
4141
return [
42+
flags.apiPermissionProperties,
4243
flags.applicationEnv,
44+
flags.applicationProperties,
45+
flags.bootstrapProperties,
4346
flags.chartDirectory,
4447
flags.deployHederaExplorer,
4548
flags.deployMirrorNode,
@@ -48,11 +51,13 @@ export class NetworkCommand extends BaseCommand {
4851
flags.fstChartVersion,
4952
flags.hederaExplorerTlsHostName,
5053
flags.hederaExplorerTlsLoadBalancerIp,
54+
flags.log4j2Xml,
5155
flags.namespace,
5256
flags.nodeIDs,
5357
flags.profileFile,
5458
flags.profileName,
5559
flags.releaseTag,
60+
flags.settingTxt,
5661
flags.tlsClusterIssuerType,
5762
flags.valuesFile
5863
]
@@ -127,10 +132,15 @@ export class NetworkCommand extends BaseCommand {
127132

128133
// disable the prompts that we don't want to prompt the user for
129134
prompts.disablePrompts([
135+
flags.apiPermissionProperties,
130136
flags.applicationEnv,
137+
flags.applicationProperties,
138+
flags.bootstrapProperties,
131139
flags.deployHederaExplorer,
132140
flags.deployMirrorNode,
133-
flags.hederaExplorerTlsLoadBalancerIp
141+
flags.hederaExplorerTlsLoadBalancerIp,
142+
flags.log4j2Xml,
143+
flags.settingTxt
134144
])
135145

136146
await prompts.execute(task, this.configManager, NetworkCommand.DEPLOY_FLAGS_LIST)

src/commands/node.mjs

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,8 @@ export class NodeCommand extends BaseCommand {
6363

6464
static get SETUP_FLAGS_LIST () {
6565
return [
66-
flags.apiPermissionProperties, // TODO move to `network deploy`
6766
flags.app,
6867
flags.appConfig,
69-
flags.applicationProperties, // TODO move to `network deploy`
70-
flags.bootstrapProperties, // TODO move to `network deploy`
7168
flags.cacheDir,
7269
flags.chainId,
7370
flags.devMode,
@@ -76,11 +73,9 @@ export class NodeCommand extends BaseCommand {
7673
flags.generateTlsKeys,
7774
flags.keyFormat,
7875
flags.localBuildPath,
79-
flags.log4j2Xml, // TODO move to `network deploy`
8076
flags.namespace,
8177
flags.nodeIDs,
82-
flags.releaseTag,
83-
flags.settingTxt // TODO move to `network deploy`
78+
flags.releaseTag
8479
]
8580
}
8681

@@ -122,9 +117,6 @@ export class NodeCommand extends BaseCommand {
122117

123118
static get ADD_FLAGS_LIST () {
124119
return [
125-
flags.apiPermissionProperties,
126-
flags.applicationProperties,
127-
flags.bootstrapProperties,
128120
flags.cacheDir,
129121
flags.chainId,
130122
flags.chartDirectory,
@@ -134,11 +126,9 @@ export class NodeCommand extends BaseCommand {
134126
flags.generateGossipKeys,
135127
flags.generateTlsKeys,
136128
flags.keyFormat,
137-
flags.log4j2Xml,
138129
flags.namespace,
139130
flags.nodeIDs,
140-
flags.releaseTag,
141-
flags.settingTxt
131+
flags.releaseTag
142132
]
143133
}
144134

@@ -423,7 +413,6 @@ export class NodeCommand extends BaseCommand {
423413
async initializeSetup (config, configManager, k8) {
424414
// compute other config parameters
425415
config.releasePrefix = Templates.prepareReleasePrefix(config.releaseTag)
426-
config.buildZipFile = `${config.cacheDir}/${config.releasePrefix}/build-${config.releaseTag}.zip`
427416
config.keysDir = path.join(validatePath(config.cacheDir), 'keys')
428417
config.stagingDir = Templates.renderStagingDir(
429418
configManager.getFlag(flags.cacheDir),
@@ -531,28 +520,20 @@ export class NodeCommand extends BaseCommand {
531520

532521
// disable the prompts that we don't want to prompt the user for
533522
prompts.disablePrompts([
534-
flags.apiPermissionProperties,
535523
flags.app,
536524
flags.appConfig,
537-
flags.applicationProperties,
538-
flags.bootstrapProperties,
539525
flags.devMode,
540526
flags.force,
541-
flags.localBuildPath,
542-
flags.log4j2Xml,
543-
flags.settingTxt
527+
flags.localBuildPath
544528
])
545529

546530
await prompts.execute(task, self.configManager, NodeCommand.SETUP_FLAGS_LIST)
547531

548532
/**
549533
* @typedef {Object} NodeSetupConfigClass
550534
* -- flags --
551-
* @property {string} apiPermissionProperties
552535
* @property {string} app
553536
* @property {string} appConfig
554-
* @property {string} applicationProperties
555-
* @property {string} bootstrapProperties
556537
* @property {string} cacheDir
557538
* @property {string} chainId
558539
* @property {boolean} devMode
@@ -561,13 +542,10 @@ export class NodeCommand extends BaseCommand {
561542
* @property {boolean} generateTlsKeys
562543
* @property {string} keyFormat
563544
* @property {string} localBuildPath
564-
* @property {string} log4j2Xml
565545
* @property {string} namespace
566546
* @property {string} nodeIDs
567547
* @property {string} releaseTag
568-
* @property {string} settingTxt
569548
* -- extra args --
570-
* @property {string} buildZipFile
571549
* @property {Date} curDate
572550
* @property {string} keysDir
573551
* @property {string[]} nodeIds
@@ -585,7 +563,6 @@ export class NodeCommand extends BaseCommand {
585563
// create a config object for subsequent steps
586564
const config = /** @type {NodeSetupConfigClass} **/ this.getConfig(NodeCommand.SETUP_CONFIGS_NAME, NodeCommand.SETUP_FLAGS_LIST,
587565
[
588-
'buildZipFile',
589566
'curDate',
590567
'keysDir',
591568
'nodeIds',
@@ -693,7 +670,6 @@ export class NodeCommand extends BaseCommand {
693670
task: () =>
694671
self.platformInstaller.taskInstall(
695672
podName,
696-
ctx.config.buildZipFile,
697673
ctx.config.stagingDir,
698674
ctx.config.nodeIds,
699675
ctx.config.keyFormat,
@@ -1045,7 +1021,6 @@ export class NodeCommand extends BaseCommand {
10451021
* @property {string} nodeIDs
10461022
* @property {string} releaseTag
10471023
* -- extra args --
1048-
* @property {string} buildZipFile
10491024
* @property {string} keysDir
10501025
* @property {string[]} nodeIds
10511026
* @property {Object} podNames
@@ -1063,7 +1038,6 @@ export class NodeCommand extends BaseCommand {
10631038
// create a config object for subsequent steps
10641039
ctx.config = /** @type {NodeRefreshConfigClass} **/ this.getConfig(NodeCommand.REFRESH_CONFIGS_NAME, NodeCommand.REFRESH_FLAGS_LIST,
10651040
[
1066-
'buildZipFile',
10671041
'keysDir',
10681042
'nodeIds',
10691043
'podNames',
@@ -1130,8 +1104,7 @@ export class NodeCommand extends BaseCommand {
11301104
subTasks.push({
11311105
title: `Node: ${chalk.yellow(nodeId)}`,
11321106
task: () =>
1133-
self.platformInstaller.taskInstall(podName, config.buildZipFile,
1134-
config.stagingDir, nodeList, config.keyFormat, config.force)
1107+
self.platformInstaller.taskInstall(podName, config.stagingDir, nodeList, config.keyFormat, config.force)
11351108
})
11361109
}
11371110

@@ -1283,25 +1256,17 @@ export class NodeCommand extends BaseCommand {
12831256

12841257
// disable the prompts that we don't want to prompt the user for
12851258
prompts.disablePrompts([
1286-
flags.apiPermissionProperties,
1287-
flags.applicationProperties,
1288-
flags.bootstrapProperties,
12891259
flags.chartDirectory,
12901260
flags.devMode,
12911261
flags.force,
1292-
flags.fstChartVersion,
1293-
flags.log4j2Xml,
1294-
flags.settingTxt
1262+
flags.fstChartVersion
12951263
])
12961264

12971265
await prompts.execute(task, self.configManager, NodeCommand.ADD_FLAGS_LIST)
12981266

12991267
/**
13001268
* @typedef {Object} NodeAddConfigClass
13011269
* -- flags --
1302-
* @property {string} apiPermissionProperties
1303-
* @property {string} applicationProperties
1304-
* @property {string} bootstrapProperties
13051270
* @property {string} cacheDir
13061271
* @property {string} chainId
13071272
* @property {string} chartDirectory
@@ -1311,14 +1276,11 @@ export class NodeCommand extends BaseCommand {
13111276
* @property {boolean} generateGossipKeys
13121277
* @property {boolean} generateTlsKeys
13131278
* @property {string} keyFormat
1314-
* @property {string} log4j2Xml
13151279
* @property {string} namespace
13161280
* @property {string} nodeIDs
13171281
* @property {string} releaseTag
1318-
* @property {string} settingTxt
13191282
* -- extra args --
13201283
* @property {string[]} allNodeIds
1321-
* @property {string} buildZipFile
13221284
* @property {Date} curDate
13231285
* @property {string[]} existingNodeIds
13241286
* @property {string} keysDir
@@ -1340,7 +1302,6 @@ export class NodeCommand extends BaseCommand {
13401302
const config = /** @type {NodeAddConfigClass} **/ this.getConfig(NodeCommand.ADD_CONFIGS_NAME, NodeCommand.ADD_FLAGS_LIST,
13411303
[
13421304
'allNodeIds',
1343-
'buildZipFile',
13441305
'curDate',
13451306
'existingNodeIds',
13461307
'keysDir',
@@ -1564,7 +1525,7 @@ export class NodeCommand extends BaseCommand {
15641525
subTasks.push({
15651526
title: `Node: ${chalk.yellow(nodeId)}`,
15661527
task: () =>
1567-
self.platformInstaller.taskInstall(podName, config.buildZipFile, config.stagingDir, config.allNodeIds, config.keyFormat, config.force)
1528+
self.platformInstaller.taskInstall(podName, config.stagingDir, config.allNodeIds, config.keyFormat, config.force)
15681529
})
15691530
}
15701531

src/core/platform_installer.mjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,22 +248,15 @@ export class PlatformInstaller {
248248
* ${staging}/keys/a-<nodeId>.crt: agreement cert for a node
249249
* ${staging}/keys/hedera-<nodeId>.key: gRPC TLS key for a node
250250
* ${staging}/keys/hedera-<nodeId>.crt: gRPC TLS cert for a node
251-
* ${staging}/properties: contains all properties files
252-
* ${staging}/log4j2.xml: LOG4J file
253-
* ${staging}/settings.txt: settings.txt file for the network
254-
* ${staging}/config.txt: config.txt file for the network
255251
*
256252
* @param podName name of the pod
257-
* @param buildZipFile path to the platform build.zip file
258253
* @param stagingDir staging directory path
259254
* @param nodeIds list of node ids
260255
* @param keyFormat key format (pfx or pem)
261256
* @param force force flag
262257
* @returns {Listr<ListrContext, ListrPrimaryRendererValue, ListrSecondaryRendererValue>}
263258
*/
264-
taskInstall (podName, buildZipFile, stagingDir, nodeIds, keyFormat = constants.KEY_FORMAT_PEM, force = false) {
265-
// TODO: buildZipFile is not used, remove it from the signature
266-
// TODO: make sure that application.properties is still being copied, it is now part of a configMap
259+
taskInstall (podName, stagingDir, nodeIds, keyFormat = constants.KEY_FORMAT_PEM, force = false) {
267260
const self = this
268261
return new Listr([
269262
{

test/test_util.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,8 @@ export function bootstrapNetwork (testName, argv,
224224
try {
225225
await expect(nodeCmd.setup(argv)).resolves.toBeTruthy()
226226
expect(nodeCmd.getUnusedConfigs(NodeCommand.SETUP_CONFIGS_NAME)).toEqual([
227-
flags.apiPermissionProperties.constName,
228227
flags.appConfig.constName,
229-
flags.applicationProperties.constName,
230-
flags.bootstrapProperties.constName,
231-
flags.devMode.constName,
232-
flags.log4j2Xml.constName,
233-
flags.settingTxt.constName
228+
flags.devMode.constName
234229
])
235230
} catch (e) {
236231
nodeCmd.logger.showUserError(e)

0 commit comments

Comments
 (0)