From 5633ef1d15c17fa2e0249710c7591da777cd7b5e Mon Sep 17 00:00:00 2001 From: Jake Correnti Date: Thu, 16 Jun 2022 15:57:01 -0400 Subject: Docker-compose disable healthcheck properly handled Previously, if a container had healthchecks disabled in the docker-compose.yml file and the user did a `podman inspect `, they would have an incorrect output: ``` "Healthcheck":{ "Test":[ "CMD-SHELL", "NONE" ], "Interval":30000000000, "Timeout":30000000000, "Retries":3 } ``` After a quick change, the correct output is now the result: ``` "Healthcheck":{ "Test":[ "NONE" ] } ``` Additionally, I extracted the hard-coded strings that were used for comparisons into constants in `libpod/define` to prevent a similar issue from recurring. Closes: #14493 Signed-off-by: Jake Correnti --- test/compose/disable_healthcheck/docker-compose.yml | 10 ++++++++++ test/compose/disable_healthcheck/tests.sh | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 test/compose/disable_healthcheck/docker-compose.yml create mode 100644 test/compose/disable_healthcheck/tests.sh (limited to 'test') diff --git a/test/compose/disable_healthcheck/docker-compose.yml b/test/compose/disable_healthcheck/docker-compose.yml new file mode 100644 index 000000000..1f608c895 --- /dev/null +++ b/test/compose/disable_healthcheck/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3.7" +services: + noHc: + image: alpine + container_name: noHc + ports: + - "4000:80" + restart: unless-stopped + healthcheck: + disable: true diff --git a/test/compose/disable_healthcheck/tests.sh b/test/compose/disable_healthcheck/tests.sh new file mode 100644 index 000000000..2460a687e --- /dev/null +++ b/test/compose/disable_healthcheck/tests.sh @@ -0,0 +1,2 @@ +podman inspect --format='{{.Config.Healthcheck.Test}}' noHc +like $output "[NONE]" "$testname: healthcheck properly disabled" -- cgit v1.2.3-54-g00ecf