Icinga / icinga2

The core of our monitoring platform with a powerful configuration language and REST API.
https://icinga.com/docs/icinga2/latest
GNU General Public License v2.0
2k stars 574 forks source link

Remove ambiguity between ConfigObject::GetZone() and Endpoint::GetZone() #8740

Open julianbrost opened 3 years ago

julianbrost commented 3 years ago

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:

This leads to confusing code where GetZone() of the same object behaves differently depending on its static type: https://github.com/Icinga/icinga2/blob/7f5225ecaa2ddf6a483f1c1f36e83b251ca1276f/lib/icingadb/icingadb-objects.cpp#L1094-L1098

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.

Ishvina commented 2 years ago

Hi! I am in an intro to swe class that is requiring me to work on my first open-source project. I was wondering if this issue is still open and if so could is this beginner-friendly?

julianbrost commented 2 years ago

Hi, thanks for your interest in contributing. This issue is still open and the resulting fix won't need any major code changes, however, the issue requires a good understanding of Icinga 2 and especially its cluster functionality to come up with a meaningful new suggestion for naming things.

Al2Klimov commented 1 year ago

What about GetEndpointZone() for referring to the zone of specifically the endpoint?