Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the broken/unused/unneeded $AIRGAP_CHECKSUMS_URL argument #1805

Merged
merged 3 commits into from
Sep 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 6 additions & 8 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ param (
$ChannelUrl = "https://update.rke2.io/v1-release/channels"
)

Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

function Write-InfoLog() {
Expand Down Expand Up @@ -355,7 +356,7 @@ function Expand-Tarball() {
$Tarball
)
Write-InfoLog "unpacking tarball file to $InstallPath"
New-Item -Path $InstallPath -Type Directory -Force
New-Item -Path $InstallPath -Type Directory -Force | Out-Null
tar xzf "$Tarball" -C "$InstallPath"
}

Expand Down Expand Up @@ -408,9 +409,6 @@ function Get-AirgapChecksums() {
$CommitHash,
[Parameter()]
[String]
$AirgapChecksumsUrl,
[Parameter()]
[String]
$StorageUrl,
[Parameter()]
[String]
Expand All @@ -424,7 +422,7 @@ function Get-AirgapChecksums() {
$archInfo = Get-ArchitectureInfo
$suffix = $archInfo.Suffix

$AirgapChecksumsUrl= "$StorageUrl/rke2-images.$suffix$CommitHash.tar.zst.sha256sum"
$AirgapChecksumsUrl = "$StorageUrl/rke2-images.$suffix$CommitHash.tar.zst.sha256sum"
# try for zst first; if that fails use gz for older release branches
if (!(Test-Download -Uri $AirgapChecksumsUrl)) {
$AirgapChecksumsUrl = "$StorageUrl/rke2-images.$suffix$CommitHash.tar.gz.sha256sum"
Expand Down Expand Up @@ -530,7 +528,7 @@ function Install-AirgapTarball() {
if ($ExpectedAirGapChecksum) {
return
}
New-Item -Path "$InstallAgentImageDir" -ItemType "Directory"
New-Item -Path $InstallAgentImageDir -ItemType Directory | Out-null
$archInfo = Get-ArchitectureInfo
$suffix = $archInfo.Suffix

Expand Down Expand Up @@ -561,7 +559,7 @@ switch ($Method) {
if (Test-Path "$temp/rke2-install") {
Remove-Item -Path "$temp/rke2-install" -Force -Recurse
}
New-Item -Path $temp -Name "rke2-install" -ItemType "Directory"
New-Item -Path $temp -Name rke2-install -ItemType Directory | Out-Null

$TMP_DIR = Join-Path -Path $temp -ChildPath "rke2-install"
$TMP_CHECKSUMS = Join-Path -Path $TMP_DIR -ChildPath "rke2.checksums"
Expand All @@ -580,7 +578,7 @@ switch ($Method) {
else {
$Version = Get-ReleaseVersion
Write-InfoLog "using $Version as release"
$AIRGAP_CHECKSUM_EXPECTED = Get-AirgapChecksums -CommitHash $Commit -AirgapChecksumsUrl $AIRGAP_CHECKSUMS_URL -StorageUrl $STORAGE_URL -TempAirgapChecksums $TMP_AIRGAP_CHECKSUMS
$AIRGAP_CHECKSUM_EXPECTED = Get-AirgapChecksums -CommitHash $Commit -StorageUrl $STORAGE_URL -TempAirgapChecksums $TMP_AIRGAP_CHECKSUMS
Get-AirgapTarball -CommitHash $Commit -AirgapTarballUrl $AIRGAP_TARBALL_URL -StorageUrl $STORAGE_URL -TempAirgapTarball $TMP_AIRGAP_TARBALL

Write-Host $Version $Version $STORAGE_URL $INSTALL_RKE2_GITHUB_URL $TMP_CHECKSUMS
Expand Down