From bba772e5f69f57686e5a83b0c8152e6d7c9807c1 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Tue, 25 Jun 2024 16:12:32 +0530 Subject: [PATCH 1/2] add check command to verify deployed endpoints --- clients/js/packages/cli/src/index.ts | 3 +++ clients/js/packages/client/src/client.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/clients/js/packages/cli/src/index.ts b/clients/js/packages/cli/src/index.ts index 3e5920bb5..a49b6f1a5 100755 --- a/clients/js/packages/cli/src/index.ts +++ b/clients/js/packages/cli/src/index.ts @@ -103,6 +103,9 @@ async function main() { case 'undeploy': client.deleteHelm(); break; + case 'check': + client.check(); + break; default: console.log(`Unknown command: ${command}`); displayUsage(); diff --git a/clients/js/packages/client/src/client.ts b/clients/js/packages/client/src/client.ts index 0d7186f49..2aca37af9 100644 --- a/clients/js/packages/client/src/client.ts +++ b/clients/js/packages/client/src/client.ts @@ -595,4 +595,10 @@ export class StarshipClient implements StarshipClientI { console.log(pid); }); } + + public check(): void { + this.checkDependencies(); + this.exec(['helm', 'version']); + this.exec(['kubectl', 'version', '--short']); + } } From 2698169add29e3a8eab3235dc6167839bfe0e887 Mon Sep 17 00:00:00 2001 From: Anmol1696 Date: Tue, 25 Jun 2024 16:14:10 +0530 Subject: [PATCH 2/2] add check command to require config --- clients/js/packages/cli/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/js/packages/cli/src/index.ts b/clients/js/packages/cli/src/index.ts index a49b6f1a5..a5af779e8 100755 --- a/clients/js/packages/cli/src/index.ts +++ b/clients/js/packages/cli/src/index.ts @@ -29,7 +29,7 @@ const questions: Question[] = params.map(name => ({ name, type: 'text' })); // Filter questions based on the command function getQuestionsForCommand(command: string): Question[] { const commonQuestions = questions.filter(q => q.name !== 'config'); - if (['start', 'deploy', 'start-ports', 'wait-for-pods'].includes(command)) { + if (['start', 'deploy', 'start-ports', 'wait-for-pods', 'check'].includes(command)) { return questions; // Include all questions, including config } else { return commonQuestions; // Exclude config