From 84fc3516cd48d3bfdb268dff5ff6cd2c658f7aa7 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Tue, 24 May 2022 17:03:15 -0700 Subject: [PATCH] dynamically get the kubectl version to download --- hack/jenkins/common.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/jenkins/common.ps1 b/hack/jenkins/common.ps1 index ab36cb378d..e4d2342ffc 100644 --- a/hack/jenkins/common.ps1 +++ b/hack/jenkins/common.ps1 @@ -32,7 +32,8 @@ $gcs_bucket="minikube-builds/logs/$env:MINIKUBE_LOCATION/$env:ROOT_JOB_ID" $env:MINIKUBE_SUPPRESS_DOCKER_PERFORMANCE="true" # Docker's kubectl breaks things, and comes earlier in the path than the regular kubectl. So download the expected kubectl and replace Docker's version. -(New-Object Net.WebClient).DownloadFile("https://dl.k8s.io/release/v1.20.0/bin/windows/amd64/kubectl.exe", "C:\Program Files\Docker\Docker\resources\bin\kubectl.exe") +$KubeVersion = (Invoke-WebRequest -Uri 'https://storage.googleapis.com/kubernetes-release/release/stable.txt' -UseBasicParsing).Content +(New-Object Net.WebClient).DownloadFile("https://dl.k8s.io/release/$KubeVersion/bin/windows/amd64/kubectl.exe", "C:\Program Files\Docker\Docker\resources\bin\kubectl.exe") # Setup the cleanup and reboot cron gsutil.cmd -m cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/windows_cleanup_and_reboot.ps1 C:\jenkins