@@ -10,6 +10,8 @@ import * as helminstaller from "./helminstaller"
1010
1111tl . setResourcePath ( path . join ( __dirname , '..' , 'task.json' ) ) ;
1212
13+ var versionToInstall = ""
14+
1315async function configureKubectl ( ) {
1416 var version = await kubectlinstaller . getKuberctlVersion ( ) ;
1517 var kubectlPath = await kubectlinstaller . downloadKubectl ( version ) ;
@@ -22,6 +24,7 @@ async function configureKubectl() {
2224
2325async function configureHelm ( ) {
2426 var version = await helminstaller . getHelmVersion ( ) ;
27+ versionToInstall = version
2528 var helmPath = await helminstaller . downloadHelm ( version ) ;
2629
2730 // prepend the tools path. instructs the agent to prepend for future tasks
@@ -32,12 +35,11 @@ async function configureHelm() {
3235
3336async function verifyHelm ( ) {
3437 console . log ( tl . loc ( "VerifyHelmInstallation" ) ) ;
35- var helmVersion = await helminstaller . getHelmVersion ( ) ;
3638 var helmToolPath = tl . which ( "helm" , true ) ;
3739 var helmTool = tl . tool ( helmToolPath ) ;
3840
3941 // Check if using Helm 2 or Helm 3
40- if ( helmVersion . startsWith ( "v2" ) ) {
42+ if ( versionToInstall . startsWith ( "v2" ) ) {
4143 helmTool . arg ( "init" ) ;
4244 helmTool . arg ( "--client-only" ) ;
4345 } else {
0 commit comments