From e60a494ab3c9a02aefbd9cd0844b3cc9bc0aa209 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 | 7 +++++-- 2 files changed, 6 insertions(+), 3 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 00304d7..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, @@ -26,7 +26,10 @@ function Update-Icinga() $NewVersion = $Component.LatestVersion; if ([string]::IsNullOrEmpty($Version) -eq $FALSE) { - $NewVersion = $Version; + # 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)) {