Skip to content

Commit 43b7e99

Browse files
committed
add TODOs
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent d407954 commit 43b7e99

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

src/commands/network.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export class NetworkCommand extends BaseCommand {
221221
ctx.config = /** @type {NetworkDeployConfigClass} **/ await self.prepareConfig(task, argv)
222222
}
223223
},
224+
// TODO create node keys and secrets
224225
{
225226
title: `Install chart '${constants.FULLSTACK_DEPLOYMENT_CHART}'`,
226227
task: async (ctx, _) => {

src/commands/node.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ export class NodeCommand extends BaseCommand {
329329
* @return a list of subtasks
330330
* @private
331331
*/
332+
// TODO: move to KeyManager and remove List2 functionality
332333
_nodeGossipKeysTaskList (keyFormat, nodeIds, keysDir, curDate = new Date(), allNodeIds = null) {
333334
allNodeIds = allNodeIds || nodeIds
334335
if (!Array.isArray(nodeIds) || !nodeIds.every((nodeId) => typeof nodeId === 'string')) {
@@ -358,6 +359,7 @@ export class NodeCommand extends BaseCommand {
358359
title: `Generate ${Templates.renderGossipPfxPrivateKeyFile(nodeId)} for node: ${chalk.yellow(nodeId)}`,
359360
task: async () => {
360361
const privatePfxFile = await self.keyManager.generatePrivatePfxKeys(keytool, nodeId, keysDir, tmpDir)
362+
// TODO: move this validation logic into keyManager.generatePrivatePfxKeys
361363
const output = await keytool.list(`-storetype pkcs12 -storepass password -keystore ${privatePfxFile}`)
362364
if (!output.includes('Your keystore contains 3 entries')) {
363365
throw new FullstackTestingError(`malformed private pfx file: ${privatePfxFile}`)
@@ -370,6 +372,7 @@ export class NodeCommand extends BaseCommand {
370372
title: `Generate ${constants.PUBLIC_PFX} file`,
371373
task: async () => {
372374
const publicPfxFile = await self.keyManager.updatePublicPfxKey(self.keytoolDepManager.getKeytool(), allNodeIds, keysDir, tmpDir)
375+
// TODO: move this validation into the keyManager.updatePublicPfxKey function
373376
const output = await keytool.list(`-storetype pkcs12 -storepass password -keystore ${publicPfxFile}`)
374377
if (!output.includes(`Your keystore contains ${allNodeIds.length * 3} entries`)) {
375378
throw new FullstackTestingError(`malformed public.pfx file: ${publicPfxFile}`)
@@ -431,6 +434,7 @@ export class NodeCommand extends BaseCommand {
431434
* @return return a list of subtasks
432435
* @private
433436
*/
437+
// TODO move to KeyManager and remove List2 functionality
434438
_nodeTlsKeyTaskList (nodeIds, keysDir, curDate = new Date()) {
435439
// check if nodeIds is an array of strings
436440
if (!Array.isArray(nodeIds) || !nodeIds.every((nodeId) => typeof nodeId === 'string')) {
@@ -462,6 +466,7 @@ export class NodeCommand extends BaseCommand {
462466
return subTasks
463467
}
464468

469+
// TODO: move to KeyManager, rename copyNodeKeysToStaging
465470
async _copyNodeKeys (nodeKey, destDir) {
466471
for (const keyFile of [nodeKey.privateKeyFile, nodeKey.certificateFile]) {
467472
if (!fs.existsSync(keyFile)) {
@@ -788,6 +793,7 @@ export class NodeCommand extends BaseCommand {
788793
},
789794
skip: (ctx, _) => !ctx.config.generateTlsKeys
790795
},
796+
// TODO: moves to `network deploy`
791797
{
792798
title: 'Prepare staging directory',
793799
task: async (ctx, parentTask) => {
@@ -1825,6 +1831,7 @@ export class NodeCommand extends BaseCommand {
18251831
valuesArg += this.prepareValuesFiles(this.profileValuesFile)
18261832
}
18271833

1834+
// TODO: update the secrets with the new/updated key(s)
18281835
await self.chartManager.upgrade(
18291836
config.namespace,
18301837
constants.FULLSTACK_DEPLOYMENT_CHART,
@@ -2147,6 +2154,7 @@ export class NodeCommand extends BaseCommand {
21472154
}
21482155
}
21492156

2157+
// TODO: move to KeyManager
21502158
async copyGossipKeysToStaging (keyFormat, keysDir, stagingKeysDir, nodeIds) {
21512159
// copy gossip keys to the staging
21522160
for (const nodeId of nodeIds) {

src/core/helpers.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export function makeBackup (fileMap = new Map(), removeOld = true) {
127127
}
128128
}
129129

130+
// TODO: now we will pull the secret and then write the backup file
130131
export function backupOldPfxKeys (nodeIds, keysDir, curDate = new Date(), dirPrefix = 'gossip-pfx') {
131132
const backupDir = createBackupDir(keysDir, `unused-${dirPrefix}`, curDate)
132133
const fileMap = new Map()
@@ -144,6 +145,7 @@ export function backupOldPfxKeys (nodeIds, keysDir, curDate = new Date(), dirPre
144145
return backupDir
145146
}
146147

148+
// TODO: now we will pull the secret and then write the backup file
147149
export function backupOldTlsKeys (nodeIds, keysDir, curDate = new Date(), dirPrefix = 'tls') {
148150
const backupDir = createBackupDir(keysDir, `unused-${dirPrefix}`, curDate)
149151
const fileMap = new Map()
@@ -158,6 +160,7 @@ export function backupOldTlsKeys (nodeIds, keysDir, curDate = new Date(), dirPre
158160
return backupDir
159161
}
160162

163+
// TODO: now we will pull the secret and then write the backup file
161164
export function backupOldPemKeys (nodeIds, keysDir, curDate = new Date(), dirPrefix = 'gossip-pem') {
162165
const backupDir = createBackupDir(keysDir, `unused-${dirPrefix}`, curDate)
163166
const fileMap = new Map()

src/core/platform_installer.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export class PlatformInstaller {
138138
}
139139
}
140140

141+
// TODO: update to copy the keys to the k8s secrets
141142
async copyGossipKeys (podName, stagingDir, nodeIds, keyFormat = constants.KEY_FORMAT_PEM) {
142143
const self = this
143144

@@ -176,6 +177,7 @@ export class PlatformInstaller {
176177
}
177178
}
178179

180+
// TODO: update to copy the keys to the k8s secrets
179181
async copyTLSKeys (podName, stagingDir) {
180182
if (!podName) throw new MissingArgumentError('podName is required')
181183
if (!stagingDir) throw new MissingArgumentError('stagingDir is required')
@@ -256,15 +258,16 @@ export class PlatformInstaller {
256258
* @param force force flag
257259
* @returns {Listr<ListrContext, ListrPrimaryRendererValue, ListrSecondaryRendererValue>}
258260
*/
261+
// TODO: rename to taskSetup
259262
taskInstall (podName, stagingDir, nodeIds, keyFormat = constants.KEY_FORMAT_PEM, force = false) {
260263
const self = this
261264
return new Listr([
262-
{
265+
{ // TODO: remove
263266
title: 'Copy Gossip keys',
264267
task: (_, task) =>
265268
self.copyGossipKeys(podName, stagingDir, nodeIds, keyFormat)
266269
},
267-
{
270+
{ // TODO: remove
268271
title: 'Copy TLS keys',
269272
task: (_, task) =>
270273
self.copyTLSKeys(podName, stagingDir, keyFormat)

0 commit comments

Comments
 (0)