Skip to content

Commit 2ae2a05

Browse files
committed
fix: start config
Signed-off-by: Ivo Yankov <[email protected]>
1 parent 83ff877 commit 2ae2a05

File tree

1 file changed

+32
-15
lines changed

1 file changed

+32
-15
lines changed

Diff for: src/commands/node/configs.mjs

+32-15
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const UPDATE_CONFIGS_NAME = 'updateConfigs'
3232
export const REFRESH_CONFIGS_NAME = 'refreshConfigs'
3333
export const KEYS_CONFIGS_NAME = 'keyConfigs'
3434
export const SETUP_CONFIGS_NAME = 'setupConfigs'
35+
export const START_CONFIGS_NAME = 'startConfigs'
3536

3637

3738
const initializeSetup = async (config, k8) => {
@@ -479,24 +480,40 @@ export const stopConfigBuilder = async function (argv, ctx, task) {
479480
}
480481

481482
export const startConfigBuilder = async function (argv, ctx, task) {
482-
ctx.config = {
483-
app: this.configManager.getFlag(flags.app),
484-
cacheDir: this.configManager.getFlag(flags.cacheDir),
485-
debugNodeAlias: this.configManager.getFlag(flags.debugNodeAlias),
486-
namespace: this.configManager.getFlag(flags.namespace),
487-
nodeAliases: helpers.parseNodeAliases(this.configManager.getFlag(flags.nodeAliasesUnparsed))
488-
}
483+
/**
484+
* @typedef {Object} NodeStartConfigClass
485+
* -- flags --
486+
* @property {string} app
487+
* @property {string} appConfig
488+
* @property {string} cacheDir
489+
* @property {boolean} devMode
490+
* @property {string} namespace
491+
* @property {string} nodeAliasesUnparsed
492+
* @property {string} debugNodeAlias
493+
* -- extra args --
494+
* @property {string} debugNodeAlias
495+
* -- methods --
496+
* @property {NodeAliases} nodeAliases
497+
*/
498+
/**
499+
* @callback getUnusedConfigs
500+
* @returns {string[]}
501+
*/
489502

490-
ctx.config.stagingDir = Templates.renderStagingDir(
491-
this.configManager.getFlag(flags.cacheDir),
492-
this.configManager.getFlag(flags.releaseTag)
493-
)
503+
// create a config object for subsequent steps
504+
const config = /** @type {NodeStartConfigClass} **/ this.getConfig(START_CONFIGS_NAME, argv.flags,
505+
[
506+
'nodeAliases'
507+
])
494508

495-
if (!await this.k8.hasNamespace(ctx.config.namespace)) {
496-
throw new SoloError(`namespace ${ctx.config.namespace} does not exist`)
509+
510+
if (!await this.k8.hasNamespace(config.namespace)) {
511+
throw new SoloError(`namespace ${config.namespace} does not exist`)
497512
}
498-
499-
return ctx.config
513+
514+
config.nodeAliases = helpers.parseNodeAliases(config.nodeAliasesUnparsed)
515+
516+
return config
500517
}
501518

502519
export const setupConfigBuilder = async function (argv, ctx, task) {

0 commit comments

Comments
 (0)