Skip to content

Commit 78d8714

Browse files
committed
Fixes update order for components to always update the framework first
1 parent 749c30e commit 78d8714

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1919

2020
* [#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
2121
* [#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
22+
* [#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
2223
* [#710](https://github.com/Icinga/icinga-powershell-framework/pull/710) Fixes various console errors while running Icinga for Windows outside of an administrative shell
2324
* [#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`
2425
* [#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

lib/core/repository/Update-Icinga.psm1

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,31 @@ function Update-Icinga()
1313
$Release = $TRUE;
1414
}
1515

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

20+
# We need to make sure that the framework is always installed first as component
21+
# to prevent possible race-conditions during update, in case we update plugins
22+
# before the framework. For plugins this applies as well, as other components
23+
# could use them as depdency
24+
if ($CurrentInstallation.ContainsKey('framework')) {
25+
$ComponentsList += 'framework';
26+
}
27+
if ($CurrentInstallation.ContainsKey('plugins')) {
28+
$ComponentsList += 'plugins';
29+
}
30+
31+
# Add all other components, but skip the framework in this case
1932
foreach ($entry in $CurrentInstallation.Keys) {
33+
if ($entry -eq 'framework' -Or $entry -eq 'plugins') {
34+
continue;
35+
}
36+
$ComponentsList += $entry;
37+
}
38+
39+
# Now process with your installation
40+
foreach ($entry in $ComponentsList) {
2041
$Component = $CurrentInstallation[$entry];
2142

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

0 commit comments

Comments
 (0)