diff --git a/silverback/cluster/types.py b/silverback/cluster/types.py index 3f5b6452..2765f11e 100644 --- a/silverback/cluster/types.py +++ b/silverback/cluster/types.py @@ -307,8 +307,10 @@ class ServiceHealth(BaseModel): class ClusterHealth(BaseModel): - ars: ServiceHealth = Field(exclude=True) # TODO: Replace w/ cluster - ccs: ServiceHealth = Field(exclude=True) # TODO: Replace w/ cluster + # TODO: Replace w/ cluster + ccs: ServiceHealth + # NOTE: network => healthy + ars: dict[str, ServiceHealth] = {} bots: dict[str, ServiceHealth] = {} @field_validator("bots", mode="before") # TODO: Fix so this is default @@ -317,7 +319,9 @@ def convert_bot_health(cls, bots): @computed_field def cluster(self) -> ServiceHealth: - return ServiceHealth(healthy=self.ars.healthy and self.ccs.healthy) + return ServiceHealth( + healthy=all(ars.healthy for ars in self.ars.values()) and self.ccs.healthy + ) class RegistryCredentialsInfo(BaseModel):