Skip to content

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

Open
@julianbrost

Description

@julianbrost

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 the endoints 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:

if (type == Endpoint::TypeInstance) {
ObjectsZone = static_cast<Endpoint*>(object.get())->GetZone();
} else {
ObjectsZone = static_pointer_cast<Zone>(object->GetZone());
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TBDTo be defined - We aren't certain about this yetcore/qualityImprove code, libraries, algorithms, inline docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions