diff --git a/Tasks/HelmInstallerV0/src/helmtoolinstaller.ts b/Tasks/HelmInstallerV0/src/helmtoolinstaller.ts index d15c6a7da0b1..91deef295320 100644 --- a/Tasks/HelmInstallerV0/src/helmtoolinstaller.ts +++ b/Tasks/HelmInstallerV0/src/helmtoolinstaller.ts @@ -10,6 +10,8 @@ import * as helminstaller from "./helminstaller" tl.setResourcePath(path.join(__dirname, '..', 'task.json')); +var helmVersion = "" + async function configureKubectl() { var version = await kubectlinstaller.getKuberctlVersion(); var kubectlPath = await kubectlinstaller.downloadKubectl(version); @@ -21,8 +23,8 @@ async function configureKubectl() { } async function configureHelm() { - var version = await helminstaller.getHelmVersion(); - var helmPath = await helminstaller.downloadHelm(version); + helmVersion = await helminstaller.getHelmVersion(); + var helmPath = await helminstaller.downloadHelm(helmVersion); // prepend the tools path. instructs the agent to prepend for future tasks if (!process.env['PATH'].startsWith(path.dirname(helmPath))) { @@ -33,10 +35,14 @@ async function configureHelm() { async function verifyHelm() { console.log(tl.loc("VerifyHelmInstallation")); var helmToolPath = tl.which("helm", true); - var helmTool = tl.tool(helmToolPath); - helmTool.arg("init"); - helmTool.arg("--client-only"); - return helmTool.exec() + + // Check if using Helm 2 or Helm 3 + if (helmVersion.startsWith("v2")) { + var helmTool = tl.tool(helmToolPath); + helmTool.arg("init"); + helmTool.arg("--client-only"); + return helmTool.exec() + } } configureHelm() diff --git a/Tasks/HelmInstallerV0/task.json b/Tasks/HelmInstallerV0/task.json index 622df7958057..11dc43ffee32 100644 --- a/Tasks/HelmInstallerV0/task.json +++ b/Tasks/HelmInstallerV0/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 159, + "Minor": 161, "Patch": 0 }, "demands": [], diff --git a/Tasks/HelmInstallerV0/task.loc.json b/Tasks/HelmInstallerV0/task.loc.json index b075c55ddcc6..c14422b422f1 100644 --- a/Tasks/HelmInstallerV0/task.loc.json +++ b/Tasks/HelmInstallerV0/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 159, + "Minor": 161, "Patch": 0 }, "demands": [], diff --git a/Tasks/HelmInstallerV1/src/helmtoolinstaller.ts b/Tasks/HelmInstallerV1/src/helmtoolinstaller.ts index 03f9e692e4a5..de875b0eeeee 100644 --- a/Tasks/HelmInstallerV1/src/helmtoolinstaller.ts +++ b/Tasks/HelmInstallerV1/src/helmtoolinstaller.ts @@ -7,9 +7,10 @@ import utils = require("./utils"); tl.setResourcePath(path.join(__dirname, '..', 'task.json')); +var version = "" async function configureHelm() { - var version = await utils.getHelmVersion(); + version = await utils.getHelmVersion(); var helmPath = await utils.downloadHelm(version); // prepend the tools path. instructs the agent to prepend for future tasks if (!process.env['PATH'].startsWith(path.dirname(helmPath))) { @@ -19,19 +20,15 @@ async function configureHelm() { async function verifyHelm() { console.log(tl.loc("VerifyHelmInstallation")); - var helmVersion = await utils.getHelmVersion(); var helmToolPath = tl.which("helm", true); - var helmTool = tl.tool(helmToolPath); - + // Check if using Helm 2 or Helm 3 - if (helmVersion.startsWith("2")) { + if (version.startsWith("v2")) { + var helmTool = tl.tool(helmToolPath); helmTool.arg("init"); helmTool.arg("--client-only"); - } else { - helmTool.arg("version"); + return helmTool.exec() } - - return helmTool.exec() } configureHelm() diff --git a/Tasks/HelmInstallerV1/task.json b/Tasks/HelmInstallerV1/task.json index 8fecade2c5a0..305546ebb903 100644 --- a/Tasks/HelmInstallerV1/task.json +++ b/Tasks/HelmInstallerV1/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 160, - "Patch": 1 + "Minor": 161, + "Patch": 0 }, "preview": true, "demands": [], diff --git a/Tasks/HelmInstallerV1/task.loc.json b/Tasks/HelmInstallerV1/task.loc.json index 25e37cdda07a..833653cba615 100644 --- a/Tasks/HelmInstallerV1/task.loc.json +++ b/Tasks/HelmInstallerV1/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 160, - "Patch": 1 + "Minor": 161, + "Patch": 0 }, "preview": true, "demands": [], @@ -41,4 +41,4 @@ "NotAValidSemverVersion": "ms-resource:loc.messages.NotAValidSemverVersion", "VerifyHelmInstallation": "ms-resource:loc.messages.VerifyHelmInstallation" } -} +} \ No newline at end of file