Sync: preserve Host api_key in override mode

fixes #2590
This commit is contained in:
Thomas Gelf 2022-08-19 10:56:26 +02:00
parent 0cf113e0a6
commit 047b14ccbf
2 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,7 @@ v1.10.0 (unreleased)
### Import and Sync
* FEATURE: clone a row for nested Dictionary/Hash entries (#2555)
* FEATURE: Sync in "override" mode now preserves Self Service API keys (#2590)
### Configuration Baskets
* BREAKING: configuration baskets no longer contain originalId (#2549)

View File

@ -704,7 +704,13 @@ class Sync
switch ($policy) {
case 'override':
$this->objects[$key]->replaceWith($object);
if ($object instanceof IcingaHost
&& !in_array('api_key', $this->rule->getSyncProperties())
) {
$this->objects[$key]->replaceWith($object, ['api_key']);
} else {
$this->objects[$key]->replaceWith($object);
}
break;
case 'merge':