Open
Description
Currently, there exist both ConfigObject::GetZone()
and Endpoint::GetZone()
. As Endpoint
inherits from ConfigObject
, it is shadowed but both are non-virtual and behave differently:
ConfigObject::GetZone()
returns the zone that the object is configured within and is relevant for the config sync.Endpoint::GetZone()
returns the zone that endpoint is a member of (as configured in theendoints
attribute of a zone) which is relevant for cluster routing.
This leads to confusing code where GetZone()
of the same object behaves differently depending on its static type:
icinga2/lib/icingadb/icingadb-objects.cpp
Lines 1094 to 1098 in 7f5225e
Also, when discussing it internally, it was quite hard to refer to both of these zone relationships so we should come up with better and more distinctive naming.