Documentation
¶
Overview ¶
Package probe implements HTTP readiness checking: the controller calls out to a container over HTTP, rather than the container self-reporting health via Docker's own HEALTHCHECK state machine. The app spec's health.readiness/liveness config is modeled on Kubernetes' prober pattern for exactly this reason, the same choice ADR 002's Consequences section already commits to over Coolify's confirmed weaker default (health checking disabled unless the user opts in, gated entirely on Docker's own HEALTHCHECK).
Two shapes, one mechanism: WaitReady polls until a freshly started container becomes ready, gating a deploy's cutover. Check runs a single attempt, for the application controller's level-triggered liveness check, where the reconcile loop itself is the loop and this package must not add a second one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check runs exactly one probe attempt against http://addr+cfg.Path, bounded by cfg.Timeout, and returns nil only for a 2xx response. cfg.Interval is ignored: a caller wanting repetition owns the repetition.
func WaitReady ¶
WaitReady polls http://addr+cfg.Path on cfg.Interval, each attempt bounded by cfg.Timeout, until a response in the 2xx range comes back or ctx is done. It returns nil on the first success, or ctx's error (wrapped with the last probe failure reason, if any) once ctx expires.
client is caller-supplied rather than using http.DefaultClient, so callers (and tests) control transport settings and can inject a client pointed at a test server.