Skip to content

Commit 262f0c4

Browse files
authored
Merge pull request #662 from Icinga:fix/update_components_always_forces_jea_update
Fix: JEA profile always modified during update process Fixes JEA-Profiles always being updated during `Update-Icinga` calls, even when no component or non JEA related components were updated
2 parents df0d24b + 03bf60d commit 262f0c4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/100-General/10-Changelog.md

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

1616
* [#659](https://github.com/Icinga/icinga-powershell-framework/pull/659) Fixes configuration writer which publishes invalid Icinga plain configuration files
1717
* [#660](https://github.com/Icinga/icinga-powershell-framework/pull/660) Fixes `Update-Icinga` not updating to the latest available version for a component and specifying `-Version` is updating to the latest one instead of the given one instead
18+
* [#662](https://github.com/Icinga/icinga-powershell-framework/pull/662) Fixes JEA-Profiles always being updated during `Update-Icinga` calls, even when no component or non JEA related components were updated
1819

1920
## 1.11.0 (2023-08-01)
2021

lib/core/repository/Update-Icinga.psm1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function Update-Icinga()
1414
}
1515

1616
$CurrentInstallation = Get-IcingaInstallation -Release:$Release -Snapshot:$Snapshot;
17+
[bool]$UpdateJEA = $FALSE;
1718

1819
foreach ($entry in $CurrentInstallation.Keys) {
1920
$Component = $CurrentInstallation[$entry];
@@ -44,11 +45,15 @@ function Update-Icinga()
4445
continue;
4546
}
4647

48+
if ($entry.ToLower() -ne 'agent' -And $entry.ToLower() -ne 'service') {
49+
$UpdateJEA = $TRUE;
50+
}
51+
4752
Install-IcingaComponent -Name $entry -Version $NewVersion -Release:$Release -Snapshot:$Snapshot -Confirm:$Confirm -Force:$Force;
4853
}
4954

5055
# Update JEA profile if JEA is enabled once the update is complete
51-
if ([string]::IsNullOrEmpty((Get-IcingaJEAContext)) -eq $FALSE) {
56+
if ([string]::IsNullOrEmpty((Get-IcingaJEAContext)) -eq $FALSE -And $UpdateJEA) {
5257
Update-IcingaJEAProfile;
5358
Restart-IcingaWindowsService;
5459
}

0 commit comments

Comments
 (0)