summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-22 14:44:26 +0100
committerGitHub <noreply@github.com>2022-03-22 14:44:26 +0100
commit02aae4a65856305f657bc3684ad1ac2a47fbc30e (patch)
tree4b358ab3c8f547ff146dc364b98838ae9dc642b3 /libpod
parentd0e9f28f87d4fc9e7ed8f465709db89a03b9376b (diff)
parent6d6bdabc8c3fd10f5770fb79d6d8702bc6cc4ec6 (diff)
downloadpodman-02aae4a65856305f657bc3684ad1ac2a47fbc30e.tar.gz
podman-02aae4a65856305f657bc3684ad1ac2a47fbc30e.tar.bz2
podman-02aae4a65856305f657bc3684ad1ac2a47fbc30e.zip
Merge pull request #13585 from flouthoc/fix-no-healthcheck
healthcheck: stop showing wrong status when `--no-healthcheck` is set
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 00019e69c..b7362e7fb 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1261,7 +1261,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)
}