From 8d7e3556d504de5874be94399c77c7903fca5995 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Fri, 3 Nov 2023 17:05:24 +0100 Subject: [PATCH] Fixes update path for v1.11.0 --- lib/core/repository/Install-IcingaComponent.psm1 | 2 +- lib/core/repository/Update-Icinga.psm1 | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/core/repository/Install-IcingaComponent.psm1 b/lib/core/repository/Install-IcingaComponent.psm1 index 48a8c97..4e3b984 100644 --- a/lib/core/repository/Install-IcingaComponent.psm1 +++ b/lib/core/repository/Install-IcingaComponent.psm1 @@ -21,7 +21,7 @@ function Install-IcingaComponent() Set-IcingaTLSVersion; - if ($Version -eq 'release') { + if ($Version.ToLower() -eq 'release' -Or $Version.ToLower() -eq 'latest') { $Version = $null; } diff --git a/lib/core/repository/Update-Icinga.psm1 b/lib/core/repository/Update-Icinga.psm1 index 2d583aa..b6df3ca 100644 --- a/lib/core/repository/Update-Icinga.psm1 +++ b/lib/core/repository/Update-Icinga.psm1 @@ -2,7 +2,7 @@ function Update-Icinga() { param ( [string]$Name = $null, - [string]$Version = $null, + [string]$Version = 'release', [switch]$Release = $FALSE, [switch]$Snapshot = $FALSE, [switch]$Confirm = $FALSE, @@ -23,10 +23,13 @@ function Update-Icinga() continue; } - if ([string]::IsNullOrEmpty($Version) -eq $FALSE){ - $NewVersion = $Component.LatestVersion; - } else { - $NewVersion = $Version; + $NewVersion = $Component.LatestVersion; + + if ([string]::IsNullOrEmpty($Version) -eq $FALSE) { + # Ensure we are backwards compatible with Icinga for Windows v1.11.0 which broke the version update feature + if ($Version.ToLower() -ne 'release' -And $Version.ToLower() -ne 'latest') { + $NewVersion = $Version; + } } if ([string]::IsNullOrEmpty($NewVersion)) {