From db3720fca52b2d27efff490ccaf784d47169a71e Mon Sep 17 00:00:00 2001 From: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:31:31 -0400 Subject: [PATCH 1/2] fix(cluster): health record was updated fixes: #136 --- silverback/cluster/types.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/silverback/cluster/types.py b/silverback/cluster/types.py index 3f5b6452..4458a142 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 From f1a80c148ac46ca0e3d7df19247dd8d0be4799f0 Mon Sep 17 00:00:00 2001 From: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:34:19 -0400 Subject: [PATCH 2/2] fix(client): forgot it was a dict now --- silverback/cluster/types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/silverback/cluster/types.py b/silverback/cluster/types.py index 4458a142..2765f11e 100644 --- a/silverback/cluster/types.py +++ b/silverback/cluster/types.py @@ -319,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):