Skip to content

Commit 9fdb195

Browse files
committed
Fixed metrics dependency on home's health check
home might not be health in the demo. depending on it prevents metrics from starting and thus brings the whole deployment down. this avoids it by both disabling the health check and changing the dependency to a simple start
1 parent a0977a2 commit 9fdb195

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/offspot_demo/prepare.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,18 @@ def prepare_for(deployment: Deployment, *, force: bool) -> int:
152152

153153
# other volumes are not accepted and thus removed (not added-back)
154154

155+
# disabled healthcheck for home (its defined in image)
156+
if svcname == "home":
157+
service["healthcheck"] = {"disable": True}
158+
159+
# remove metrics dependency to home being healthy as we disabled healthcheck
160+
if (
161+
svcname == "metrics"
162+
and service.get("depends_on", {}).get("home", {}).get("condition", "")
163+
== "service_healthy"
164+
):
165+
service["depends_on"]["home"]["condition"] = "service_started"
166+
155167
# remove cap_add for all ; will break captive portal but it's OK
156168
if "cap_add" in service:
157169
del service["cap_add"]

0 commit comments

Comments
 (0)