Skip to content

Commit 6ae3538

Browse files
committed
Fixes JEA profile always modified during update process
1 parent 928efd3 commit 6ae3538

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

doc/100-General/10-Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1414
### Bugfixes
1515

1616
* [#659](https://github.com/Icinga/icinga-powershell-framework/pull/659) Fixes configuration writer which publishes invalid Icinga plain configuration files
17+
* [#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
1719

1820
## 1.11.0 (2023-08-01)
1921

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)