Fix overwriting the Healthcheck configuration from the image

If the --health-cmd flag is not specified, other flags such as --health-interval, --health-timeout, --health-retries, and --health-start-period are ignored if the image contains a Healthcheck. This makes it impossible to modify these Healthcheck configuration when a container is created.

Fixes: https://github.com/containers/podman/issues/20212
Fixes: https://issues.redhat.com/browse/RUN-2629

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
Jan Rodák
2025-03-25 14:08:13 +01:00
parent 61693432e6
commit b5a1b512c9
10 changed files with 147 additions and 20 deletions

View File

@ -10,3 +10,5 @@ to be applied. A value of **none** disables existing healthchecks.
Multiple options can be passed in the form of a JSON array; otherwise, the command is interpreted
as an argument to **/bin/sh -c**.
Note: The default values are used even if healthcheck is configured in the image.

View File

@ -5,3 +5,5 @@
#### **--health-interval**=*interval*
Set an interval for the healthchecks. An _interval_ of **disable** results in no automatic timer setup. The default is **30s**.
Note: This parameter will overwrite related healthcheck configuration from the image.

View File

@ -5,3 +5,5 @@
#### **--health-retries**=*retries*
The number of retries allowed before a healthcheck is considered to be unhealthy. The default value is **3**.
Note: This parameter can overwrite the healthcheck configuration from the image.

View File

@ -12,3 +12,5 @@ the container's health state will be updated to `healthy`. However, if the healt
stay as `starting` until either the health check is successful or until the `--health-start-period` time is over. If the
health check command fails after the `--health-start-period` time is over, the health state will be updated to `unhealthy`.
The health check command is executed periodically based on the value of `--health-interval`.
Note: This parameter will overwrite related healthcheck configuration from the image.

View File

@ -10,3 +10,5 @@ value can be expressed in a time format such as **1m22s**. The default value is
Note: A timeout marks the healthcheck as failed but does not terminate the running process.
This ensures that a slow but eventually successful healthcheck does not disrupt the container
but is still accounted for in the health status.
Note: This parameter will overwrite related healthcheck configuration from the image.