Skip to content

Commit

Permalink
feat: ensured user-provided values file takes precedence over solo-ge…
Browse files Browse the repository at this point in the history
…nerated values (#615)

Signed-off-by: instamenta <instamenta@abv.bg>
  • Loading branch information
instamenta authored Sep 19, 2024
1 parent 11880c5 commit 1b0ffc9
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)
}

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)
}

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)
}

return valuesArg
}

Expand Down

0 comments on commit 1b0ffc9

Please sign in to comment.