Skip to content

Commit 4f2f16b

Browse files
committed
Helm installer fix for v3
1 parent 69dcaa5 commit 4f2f16b

File tree

6 files changed

+28
-12
lines changed

6 files changed

+28
-12
lines changed

Tasks/HelmInstallerV0/src/helmtoolinstaller.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,18 @@ async function configureHelm() {
3232

3333
async function verifyHelm() {
3434
console.log(tl.loc("VerifyHelmInstallation"));
35+
var helmVersion = await helminstaller.getHelmVersion();
3536
var helmToolPath = tl.which("helm", true);
3637
var helmTool = tl.tool(helmToolPath);
37-
helmTool.arg("init");
38-
helmTool.arg("--client-only");
38+
39+
// Check if using Helm 2 or Helm 3
40+
if (helmVersion.startsWith("v2")) {
41+
helmTool.arg("init");
42+
helmTool.arg("--client-only");
43+
} else {
44+
helmTool.arg("version");
45+
}
46+
3947
return helmTool.exec()
4048
}
4149

Tasks/HelmInstallerV0/task.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 0,
16-
"Minor": 155,
17-
"Patch": 1
16+
"Minor": 159,
17+
"Patch": 0
1818
},
1919
"demands": [],
2020
"satisfies": [

Tasks/HelmInstallerV0/task.loc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"author": "Microsoft Corporation",
1414
"version": {
1515
"Major": 0,
16-
"Minor": 155,
17-
"Patch": 1
16+
"Minor": 159,
17+
"Patch": 0
1818
},
1919
"demands": [],
2020
"satisfies": [
@@ -93,4 +93,4 @@
9393
"HelmLatestNotKnown": "ms-resource:loc.messages.HelmLatestNotKnown",
9494
"VerifyHelmInstallation": "ms-resource:loc.messages.VerifyHelmInstallation"
9595
}
96-
}
96+
}

Tasks/HelmInstallerV1/src/helmtoolinstaller.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@ async function configureHelm() {
2020

2121
async function verifyHelm() {
2222
console.log(tl.loc("VerifyHelmInstallation"));
23+
var helmVersion = await utils.getHelmVersion();
2324
var helmToolPath = tl.which("helm", true);
2425
var helmTool = tl.tool(helmToolPath);
25-
helmTool.arg("init");
26-
helmTool.arg("--client-only");
26+
27+
// Check if using Helm 2 or Helm 3
28+
if (helmVersion.startsWith("v2")) {
29+
helmTool.arg("init");
30+
helmTool.arg("--client-only");
31+
} else {
32+
helmTool.arg("version");
33+
}
34+
2735
return helmTool.exec()
2836
}
2937

Tasks/HelmInstallerV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 1,
1616
"Minor": 159,
17-
"Patch": 2
17+
"Patch": 3
1818
},
1919
"preview": true,
2020
"demands": [],

Tasks/HelmInstallerV1/task.loc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 1,
1616
"Minor": 159,
17-
"Patch": 2
17+
"Patch": 3
1818
},
1919
"preview": true,
2020
"demands": [],
@@ -41,4 +41,4 @@
4141
"NotAValidSemverVersion": "ms-resource:loc.messages.NotAValidSemverVersion",
4242
"VerifyHelmInstallation": "ms-resource:loc.messages.VerifyHelmInstallation"
4343
}
44-
}
44+
}

0 commit comments

Comments
 (0)