Remove ambiguity between ConfigObject::GetZone() and Endpoint::GetZone() #8740
Labels
core/quality
Improve code, libraries, algorithms, inline docs
TBD
To be defined - We aren't certain about this yet
Currently, there exist both
ConfigObject::GetZone()
andEndpoint::GetZone()
. AsEndpoint
inherits fromConfigObject
, 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.
The text was updated successfully, but these errors were encountered: