fix(dev): stop the dev stack /ready 503 from Infisical #471
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-707-dev-ready-infisical-probe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
compose.dev.yml hardcoded
INFISICAL_BASE_URL: http://infisical:8080on the server service while theinfisicalservice itself sits behind theinfisicalcompose profile, whichjust devdoes not start. The readiness handler treats a setINFISICAL_BASE_URLas opt-in to the probe, so a plainjust devstack probed an absent host, failed after the 1s client timeout, and returned 503 withchecks.infisicalset to the error on every/api/v1/ready.Compose now interpolates
${MOKOSH_SERVER_INFISICAL_BASE_URL:-}, which renders as an empty value by default. The distinct name is deliberate:.envalready carries a host-sideINFISICAL_BASE_URL=http://localhost:28002thatjust infisical-bootstrapconsumes on the host, so the in-network service-DNS form needs its own key rather than a re-used one.An empty value alone was not enough, because
env::varreturnsOk("")for a variable set to the empty string.infisical_probe()now treats unset, empty, and whitespace-only alike as unconfigured, so the probe reports "skipped" instead of dialling an empty URL. The build path is split intobuild_infisical_probe()andrun_infisical_probe()so both the blank rule and the configured-but-unreachable error path are unit testable without touching the process-globalOnceLock.tests/readiness.rsnow sets the empty value rather than removing the key, which is the exact shape compose hands the container, so the integration test guards the rule end to end.just dev-infisicalwritesMOKOSH_SERVER_INFISICAL_BASE_URL=http://infisical:8080into.envbefore bringing the profile up, reusing the in-place rewrite patternjust devalready uses forMOKOSH_HOST_BIND_IPandUSER, so the opt-in path stays a single command.#PMS-707