Skip to content

Commit

Permalink
Merge pull request #708 from Icinga:fix/framework_update_order
Browse files Browse the repository at this point in the history
Fix: Update order for components to always update the framework first

Fixes the order for updating components with `Update-Icinga`, to ensure the `framework` is always updated first before all other components
  • Loading branch information
LordHepipud authored Apr 9, 2024
2 parents e0d7bdf + b280ccf commit 9a20904
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/100-General/10-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic

* [#672](https://github.com/Icinga/icinga-powershell-framework/pull/issues) Fixes Icinga for Windows REST-Api to fully read client data, even when they client is sending the packets on a very slow basis, preventing the API trying to process an incomplete request
* [#707](https://github.com/Icinga/icinga-powershell-framework/pull/707) Fixes size of the `Icinga for Windows` eventlog by setting it to `20MiB`, allowing to store more events before they are overwritten
* [#708](https://github.com/Icinga/icinga-powershell-framework/pull/708) Fixes the order for updating components with `Update-Icinga`, to ensure the `framework` is always updated first before all other components
* [#710](https://github.com/Icinga/icinga-powershell-framework/pull/710) Fixes various console errors while running Icinga for Windows outside of an administrative shell
* [#713](https://github.com/Icinga/icinga-powershell-framework/pull/713) Fixes Icinga for Windows REST-Api which fails during certificate auth handling while running as `NT Authority\NetworkService`
* [#714](https://github.com/Icinga/icinga-powershell-framework/pull/714) Fixes missing service environment information during initial setup of Icinga for Windows v1.12 on some systems
Expand Down
25 changes: 23 additions & 2 deletions lib/core/repository/Update-Icinga.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,31 @@ function Update-Icinga()
$Release = $TRUE;
}

$CurrentInstallation = Get-IcingaInstallation -Release:$Release -Snapshot:$Snapshot;
[bool]$UpdateJEA = $FALSE;
$CurrentInstallation = Get-IcingaInstallation -Release:$Release -Snapshot:$Snapshot;
[bool]$UpdateJEA = $FALSE;
[array]$ComponentsList = @();

# We need to make sure that the framework is always installed first as component
# to prevent possible race-conditions during update, in case we update plugins
# before the framework. For plugins this applies as well, as other components
# could use them as depdency
if ($CurrentInstallation.ContainsKey('framework')) {
$ComponentsList += 'framework';
}
if ($CurrentInstallation.ContainsKey('plugins')) {
$ComponentsList += 'plugins';
}

# Add all other components, but skip the framework in this case
foreach ($entry in $CurrentInstallation.Keys) {
if ($entry -eq 'framework' -Or $entry -eq 'plugins') {
continue;
}
$ComponentsList += $entry;
}

# Now process with your installation
foreach ($entry in $ComponentsList) {
$Component = $CurrentInstallation[$entry];

if ([string]::IsNullOrEmpty($Name) -eq $FALSE -And $Name -ne $entry) {
Expand Down

0 comments on commit 9a20904

Please sign in to comment.