Compare commits

...

6 Commits

Author SHA1 Message Date
Vojtěch Fošnár
ae3276cf90
Merge 2ba9337342 into 936665aac3 2024-09-27 20:43:08 +00:00
Vojtěch Fošnár
2ba9337342 Apply suggestions for docker compose healthcheck
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2024-01-20 03:39:05 +08:00
Vojtěch Fošnár
0b0f081a13 treat the starting state of a docker container as DOWN 2024-01-20 03:39:05 +08:00
Vojtěch Fošnár
0b478404cf make DOWN the default fallback for docker container healthcheck 2024-01-20 03:39:05 +08:00
Vojtěch Fošnár
7f5dfcc051 fix #3767 by @nougad - treat empty healthcheck reported by podman as up 2024-01-20 03:39:05 +08:00
Vojtěch Fošnár
d73684115a fix #4369 - treat unhealthy docker container as down 2024-01-20 03:39:05 +08:00

View File

@ -774,12 +774,14 @@ class Monitor extends BeanModel {
let res = await axios.request(options);
if (res.data.State.Running) {
if (res.data.State.Health && res.data.State.Health.Status !== "healthy") {
bean.status = PENDING;
if (res.data.State.Health) {
// treat empty Status as healthy to support podman: https://github.com/louislam/uptime-kuma/issues/3767
const containerIsHealthy = [ "", "healthy" ].includes(res.data.State.Health.Status);
bean.status = containerIsHealthy ? UP : DOWN;
bean.msg = res.data.State.Health.Status;
} else {
bean.status = UP;
bean.msg = res.data.State.Health ? res.data.State.Health.Status : res.data.State.Status;
bean.status = DOWN;
bean.msg = res.data.State.Status;
}
} else {
throw Error("Container State is " + res.data.State.Status);