mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
Only sync objects actually belonging to a cluster zone
refs #9927 refs #9100
This commit is contained in:
parent
f2c3bffdd9
commit
57179f3bdd
@ -248,6 +248,10 @@ void ApiListener::UpdateConfigObject(const ConfigObject::Ptr& object, const Mess
|
|||||||
if (object->GetPackage() != "_api")
|
if (object->GetPackage() != "_api")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* don't sync objects without a zone attribute */
|
||||||
|
if (object->GetZoneName().IsEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
Dictionary::Ptr message = new Dictionary();
|
Dictionary::Ptr message = new Dictionary();
|
||||||
message->Set("jsonrpc", "2.0");
|
message->Set("jsonrpc", "2.0");
|
||||||
message->Set("method", "config::UpdateObject");
|
message->Set("method", "config::UpdateObject");
|
||||||
@ -303,6 +307,10 @@ void ApiListener::DeleteConfigObject(const ConfigObject::Ptr& object, const Mess
|
|||||||
if (object->GetPackage() != "_api")
|
if (object->GetPackage() != "_api")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* don't sync objects without a zone attribute */
|
||||||
|
if (object->GetZoneName().IsEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
Dictionary::Ptr message = new Dictionary();
|
Dictionary::Ptr message = new Dictionary();
|
||||||
message->Set("jsonrpc", "2.0");
|
message->Set("jsonrpc", "2.0");
|
||||||
message->Set("method", "config::DeleteObject");
|
message->Set("method", "config::DeleteObject");
|
||||||
@ -346,17 +354,12 @@ void ApiListener::SendRuntimeConfigObjects(const JsonRpcConnection::Ptr& aclient
|
|||||||
|
|
||||||
String objZone = object->GetZoneName();
|
String objZone = object->GetZoneName();
|
||||||
|
|
||||||
/* only sync objects in the same zone if no zone attribute was set */
|
/* don't sync objects without a zone attribute */
|
||||||
if (objZone.IsEmpty() && azone != lzone) {
|
if (objZone.IsEmpty())
|
||||||
Log(LogDebug, "ApiListener")
|
|
||||||
<< "Skipping sync: No object zone specified and client zone '"
|
|
||||||
<< azone->GetName() << "' does not match local zone '"
|
|
||||||
<< lzone->GetName() << "'.";
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
/* don't sync objects for non-matching parent-child zones */
|
/* don't sync objects for non-matching parent-child zones */
|
||||||
if (!objZone.IsEmpty() && !azone->IsChildOf(lzone)) {
|
if (!azone->IsChildOf(lzone) && azone != lzone) {
|
||||||
Log(LogDebug, "ApiListener")
|
Log(LogDebug, "ApiListener")
|
||||||
<< "Skipping sync: object zone '" << objZone
|
<< "Skipping sync: object zone '" << objZone
|
||||||
<< "' defined but client zone '" << azone->GetName()
|
<< "' defined but client zone '" << azone->GetName()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user