Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update helm.ts: add try-catch over helm version #1170

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update helm.ts: add try-catch over helm version
fixes #1169
  • Loading branch information
0x53A committed Jun 19, 2020
commit 92a1241a4aeb3a62f487430530c7203baf1dbb37
17 changes: 11 additions & 6 deletions provider/pkg/gen/nodejs-templates/helm/v2/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,17 @@ export class Chart extends yaml.CollectionComponentResource {

// Check the helm version - v2 or v3
let helmVerCmd = `helm version --short || true`;
const helmVer = execSync(
helmVerCmd,
{
stdio: ['pipe', 'pipe', 'ignore'], // Suppress tiller version error
},
).toString();
var helmVer;
try {
helmVer = execSync(
helmVerCmd,
{
stdio: ['pipe', 'pipe', 'ignore'], // Suppress tiller version error
},
).toString();
} catch (e) {
helmVer = e.stdout.toString();
}

cmd = `helm template ${chart} --name-template ${release} --values ${defaultValues} --values ${values} ${apiVersionsArgs} ${namespaceArg}`;
// Helm v2 returns version like this:
Expand Down