diff --git a/src/commands/network.ts b/src/commands/network.ts index 6d97c0fc2..a27d7d203 100644 --- a/src/commands/network.ts +++ b/src/commands/network.ts @@ -230,6 +230,15 @@ export class NetworkCommand extends BaseCommand { return lease.buildAcquireTask(task) } }, + { + title: 'Check if cluster setup chart is installed', + task: async (ctx, task) => { + const isChartInstalled = await this.chartManager.isChartInstalled('', constants.SOLO_CLUSTER_SETUP_CHART) + if (!isChartInstalled) { + throw new SoloError(`Chart ${constants.SOLO_CLUSTER_SETUP_CHART} is not installed. Run 'solo cluster setup'`) + } + } + }, { title: 'Prepare staging directory', task: (_, parentTask) => { @@ -547,7 +556,7 @@ export class NetworkCommand extends BaseCommand { return yargs .command({ command: 'deploy', - desc: 'Deploy solo network', + desc: "Deploy solo network. Requires the chart `solo-cluster-setup` to have been installed in the cluster. If it hasn't the following command can be ran: `solo cluster setup`", builder: (y: any) => flags.setCommandFlags(y, ...NetworkCommand.DEPLOY_FLAGS_LIST), handler: (argv: any) => { networkCmd.logger.debug('==== Running \'network deploy\' ===') diff --git a/src/core/chart_manager.ts b/src/core/chart_manager.ts index ed62ecce3..5a374d959 100644 --- a/src/core/chart_manager.ts +++ b/src/core/chart_manager.ts @@ -58,6 +58,9 @@ export class ChartManager { /** List available clusters */ async getInstalledCharts (namespaceName: string) { try { + if (!namespaceName) { + return await this.helm.list('--all-namespaces --no-headers | awk \'{print $1 " [" $9"]"}\'') + } return await this.helm.list(`-n ${namespaceName}`, '--no-headers | awk \'{print $1 " [" $9"]"}\'') } catch (e: Error | any) { this.logger.showUserError(e)