mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 23:28:57 +00:00
Update to latest kind version (#954)
This commit is contained in:
committed by
GitHub
parent
8290bdeb6e
commit
9b76f6f84b
@@ -6,12 +6,10 @@
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
source $HELPER_SCRIPTS/apt.sh
|
||||
|
||||
# Install KIND
|
||||
KIND_VERSION="v0.7.0"
|
||||
|
||||
curl -L -o /usr/local/bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64"
|
||||
URL=$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kind-linux-amd64"))')
|
||||
curl -L -o /usr/local/bin/kind $URL
|
||||
chmod +x /usr/local/bin/kind
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
|
||||
@@ -3,37 +3,38 @@
|
||||
## Desc: Install Kind
|
||||
################################################################################
|
||||
|
||||
$stableKindTag = "v0.7.0"
|
||||
$tagToUse = $stableKindTag;
|
||||
$destFilePath = "C:\ProgramData\kind"
|
||||
function Get-LatestRelease
|
||||
{
|
||||
$url = 'https://api.github.com/repos/kubernetes-sigs/kind/releases/latest'
|
||||
(Invoke-RestMethod -Uri $url).assets.browser_download_url -match "kind-windows-amd64"
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$kindUrl = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64"
|
||||
|
||||
Write-Host "Downloading kind.exe..."
|
||||
New-Item -Path $destFilePath -ItemType Directory -Force
|
||||
Write-Host "Starting Install kind.exe..."
|
||||
$destFilePath = "C:\ProgramData\kind"
|
||||
$null = New-Item -Path $destFilePath -ItemType Directory -Force
|
||||
|
||||
$kindUrl = Get-LatestRelease
|
||||
$kindInstallerPath = Start-DownloadWithRetry -Url $kindUrl -Name "kind.exe" -DownloadPath $destFilePath
|
||||
|
||||
Write-Host "Starting Install kind.exe..."
|
||||
$process = Start-Process -FilePath $kindInstallerPath -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
Write-Host 'Installation successful'
|
||||
Add-MachinePathItem $destFilePath
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
Write-Host "Non zero exit code returned by the installation process : $exitCode."
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the Executable kind.exe"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
Write-Host "Failed to install the Executable kind.exe"
|
||||
Write-Host $_.Exception.Message
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user