Merge pull request #9785 from Icinga/Al2Klimov-patch-8

Icinga DB: also write ConfigObject#original_attributes into Redis
This commit is contained in:
Julian Brost 2023-06-27 10:24:41 +02:00 committed by GitHub
commit c08d3beeb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1233,9 +1233,16 @@ void IcingaDB::AddObjectDataToRuntimeUpdates(std::vector<Dictionary::Ptr>& runti
// for IcingaDB.
bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& attributes, Dictionary::Ptr& checksums)
{
auto originalAttrs (object->GetOriginalAttributes());
if (originalAttrs) {
originalAttrs = originalAttrs->ShallowClone();
}
attributes->Set("name_checksum", SHA1(object->GetName()));
attributes->Set("environment_id", m_EnvironmentId);
attributes->Set("name", object->GetName());
attributes->Set("original_attributes", originalAttrs);
Zone::Ptr ObjectsZone;
Type::Ptr type = object->GetReflectionType();