Skip to content

Commit

Permalink
ensured user-provided values file takes precedence over solo-generate…
Browse files Browse the repository at this point in the history
…d values

Signed-off-by: instamenta <[email protected]>
  • Loading branch information
instamenta committed Sep 19, 2024
1 parent 11880c5 commit 2dab8b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/commands/mirror_node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ export class MirrorNodeCommand extends BaseCommand {
*/
async prepareValuesArg (config) {
let valuesArg = ''
if (config.valuesFile) {
valuesArg += this.prepareValuesFiles(config.valuesFile)
}

const profileName = this.configManager.getFlag(flags.profileName)
const profileValuesFile = await this.profileManager.prepareValuesForMirrorNodeChart(profileName)
Expand All @@ -122,6 +119,11 @@ export class MirrorNodeCommand extends BaseCommand {
}

valuesArg += ` --set hedera-mirror-node.enabled=true --set hedera-explorer.enabled=${config.deployHederaExplorer}`

if (config.valuesFile) {
valuesArg += this.prepareValuesFiles(config.valuesFile)

Check warning on line 124 in src/commands/mirror_node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/mirror_node.mjs#L124

Added line #L124 was not covered by tests
}

return valuesArg
}

Expand Down
8 changes: 4 additions & 4 deletions src/commands/network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ export class NetworkCommand extends BaseCommand {
valuesArg = `-f ${path.join(config.chartDirectory, 'fullstack-deployment', 'values.yaml')}`
}

if (config.valuesFile) {
valuesArg += this.prepareValuesFiles(config.valuesFile)
}

if (config.app !== constants.HEDERA_APP_NAME) {
const index = config.nodeIds.length
for (let i = 0; i < index; i++) {
Expand Down Expand Up @@ -124,6 +120,10 @@ export class NetworkCommand extends BaseCommand {

valuesArg += ` --set "defaults.volumeClaims.enabled=${config.persistentVolumeClaims}"`

if (config.valuesFile) {
valuesArg += this.prepareValuesFiles(config.valuesFile)

Check warning on line 124 in src/commands/network.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/network.mjs#L124

Added line #L124 was not covered by tests
}

this.logger.debug('Prepared helm chart values', { valuesArg })
return valuesArg
}
Expand Down
10 changes: 6 additions & 4 deletions src/commands/relay.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class RelayCommand extends BaseCommand {

/**
* @param {string} valuesFile
* @param {string} nodeIDs
* @param {string[]} nodeIDs
* @param {string} chainID
* @param {string} relayRelease
* @param {number} replicaCount
Expand All @@ -78,9 +78,6 @@ export class RelayCommand extends BaseCommand {
*/
async prepareValuesArg (valuesFile, nodeIDs, chainID, relayRelease, replicaCount, operatorID, operatorKey, namespace) {
let valuesArg = ''
if (valuesFile) {
valuesArg += this.prepareValuesFiles(valuesFile)
}

const profileName = this.configManager.getFlag(flags.profileName)
const profileValuesFile = await this.profileManager.prepareValuesForRpcRelayChart(profileName)
Expand Down Expand Up @@ -120,6 +117,11 @@ export class RelayCommand extends BaseCommand {

const networkJsonString = await this.prepareNetworkJsonString(nodeIDs, namespace)
valuesArg += ` --set config.HEDERA_NETWORK='${networkJsonString}'`

if (valuesFile) {
valuesArg += this.prepareValuesFiles(valuesFile)

Check warning on line 122 in src/commands/relay.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/relay.mjs#L122

Added line #L122 was not covered by tests
}

return valuesArg
}

Expand Down

0 comments on commit 2dab8b7

Please sign in to comment.