mirror of
https://github.com/containers/podman.git
synced 2025-10-18 19:53:58 +08:00
healthcheck: stop showing wrong status when --no-healthcheck is set
Containers started with `--no-healthcheck` are configured to contain no healthcheck and test configured as `NONE`. Podman shows wrong status as such use cases. Following commit fixes the faulty behavior of stauts field for containers started with `--no-healthcheck` Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
@ -1268,7 +1268,10 @@ func (c *Container) start() error {
|
||||
}
|
||||
}
|
||||
|
||||
if c.config.HealthCheckConfig != nil {
|
||||
// Check if healthcheck is not nil and --no-healthcheck option is not set.
|
||||
// If --no-healthcheck is set Test will be always set to `[NONE]` so no need
|
||||
// to update status in such case.
|
||||
if c.config.HealthCheckConfig != nil && !(len(c.config.HealthCheckConfig.Test) == 1 && c.config.HealthCheckConfig.Test[0] == "NONE") {
|
||||
if err := c.updateHealthStatus(define.HealthCheckStarting); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user