Icinga DB: also write ConfigObject#original_attributes into Redis

for the case the Go daemon decides to sync them into DB.
This commit is contained in:
Alexander A. Klimov 2023-06-12 12:53:25 +02:00
parent a3dabde28a
commit 385fe2fd76

View File

@ -1232,9 +1232,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();