Fix inverted IsHACluster check

This commit is contained in:
Yonas Habteab 2025-04-23 12:06:26 +02:00
parent 520aed6049
commit 1da497be89
3 changed files with 5 additions and 9 deletions

View File

@ -1927,11 +1927,7 @@ void ApiListener::ValidateTlsHandshakeTimeout(const Lazy<double>& lvalue, const
bool ApiListener::IsHACluster()
{
Zone::Ptr zone = Zone::GetLocalZone();
if (!zone)
return false;
return zone->IsSingleInstance();
return zone && zone->IsHACluster();
}
/* Provide a helper function for zone origin name. */

View File

@ -125,10 +125,10 @@ bool Zone::IsGlobal() const
return GetGlobal();
}
bool Zone::IsSingleInstance() const
bool Zone::IsHACluster() const
{
Array::Ptr endpoints = GetEndpointsRaw();
return !endpoints || endpoints->GetLength() < 2;
auto endpoints = GetEndpointsRaw();
return endpoints && endpoints->GetLength() >= 2;
}
Zone::Ptr Zone::GetLocalZone()

View File

@ -29,7 +29,7 @@ public:
bool CanAccessObject(const ConfigObject::Ptr& object);
bool IsChildOf(const Zone::Ptr& zone);
bool IsGlobal() const;
bool IsSingleInstance() const;
bool IsHACluster() const;
static Zone::Ptr GetLocalZone();