From 2a524fcaec4e6f66461d7cdda1bb73ed7c50f026 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Wed, 15 Dec 2021 13:32:57 -0600 Subject: fix healthcheck timeouts and ut8 coercion this commit fixes two bugs and adds regression tests. when getting healthcheck values from an image, if the image does not have a timeout defined, this resulted in a 0 value for timeout. The default as described in the man pages is 30s. when inspecting a container with a healthcheck command, a customer observed that the &, <, and > characters were being converted into a unicode escape value. It turns out json marshalling will by default coerce string values to ut8. Fixes: bz2028408 Signed-off-by: Brent Baude --- libpod/define/healthchecks.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libpod') diff --git a/libpod/define/healthchecks.go b/libpod/define/healthchecks.go index 4114262b6..bde449d30 100644 --- a/libpod/define/healthchecks.go +++ b/libpod/define/healthchecks.go @@ -34,3 +34,16 @@ const ( // HealthCheckDefined means the healthcheck was found on the container HealthCheckDefined HealthCheckStatus = iota ) + +// Healthcheck defaults. These are used both in the cli as well in +// libpod and were moved from cmd/podman/common +const ( + // DefaultHealthCheckInterval default value + DefaultHealthCheckInterval = "30s" + // DefaultHealthCheckRetries default value + DefaultHealthCheckRetries uint = 3 + // DefaultHealthCheckStartPeriod default value + DefaultHealthCheckStartPeriod = "0s" + // DefaultHealthCheckTimeout default value + DefaultHealthCheckTimeout = "30s" +) -- cgit v1.2.3-54-g00ecf