From b64cc85008c252e7ba026030f9687b6ef5366789 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Thu, 13 Jun 2024 22:05:27 +0530 Subject: [PATCH] fix args for deploy command --- clients/js/packages/client/src/client.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/clients/js/packages/client/src/client.ts b/clients/js/packages/client/src/client.ts index e2ae6bfc..ede61e5d 100644 --- a/clients/js/packages/client/src/client.ts +++ b/clients/js/packages/client/src/client.ts @@ -208,6 +208,14 @@ export class StarshipClient implements StarshipClientI { return args; } + public getDeployArgs(): string[] { + const args = this.getArgs(); + if (this.ctx.helmNamespace) { + args.push('--create-namespace'); + } + return args; + } + // TODO do we need this here? public test(): void { this.exec([ @@ -271,7 +279,7 @@ export class StarshipClient implements StarshipClientI { this.ctx.helmChart, '--version', this.ctx.helmVersion, - ...this.getArgs(), + ...this.getDeployArgs(), ...options, ]; @@ -322,7 +330,7 @@ export class StarshipClient implements StarshipClientI { '-o', 'custom-columns=:metadata.name', ...this.getArgs(), - ], false, false) + ], false, true) // Split the output by new lines and filter out any empty lines const podNames = result.split('\n').filter(name => name.trim() !== ''); @@ -350,7 +358,7 @@ export class StarshipClient implements StarshipClientI { '-o', 'custom-columns=:status.phase,:status.containerStatuses[*].state.waiting.reason', ...this.getArgs(), - ], true, false).trim(); + ], false, true).trim(); const [status, reason] = result.split(' '); this.podStatuses.set(podName, status);