diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-07-05 13:50:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-05 13:50:35 +0000 |
commit | 340eeed0cb20855f1e6d2670704cfe67df3314f6 (patch) | |
tree | 8fa91b359c7def9238c3835d55e7c00179896707 /libpod | |
parent | 2c9f0753da6486b7ed2ef3b37b65ae0b9ca6d3fe (diff) | |
parent | 5633ef1d15c17fa2e0249710c7591da777cd7b5e (diff) | |
download | podman-340eeed0cb20855f1e6d2670704cfe67df3314f6.tar.gz podman-340eeed0cb20855f1e6d2670704cfe67df3314f6.tar.bz2 podman-340eeed0cb20855f1e6d2670704cfe67df3314f6.zip |
Merge pull request #14626 from jakecorrenti/disable-docker-compose-health-check
Docker-compose disable healthcheck properly handled
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/define/healthchecks.go | 10 | ||||
-rw-r--r-- | libpod/healthcheck.go | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/libpod/define/healthchecks.go b/libpod/define/healthchecks.go index bde449d30..f71274350 100644 --- a/libpod/define/healthchecks.go +++ b/libpod/define/healthchecks.go @@ -47,3 +47,13 @@ const ( // DefaultHealthCheckTimeout default value DefaultHealthCheckTimeout = "30s" ) + +// HealthConfig.Test options +const ( + // HealthConfigTestNone disables healthcheck + HealthConfigTestNone = "NONE" + // HealthConfigTestCmd execs arguments directly + HealthConfigTestCmd = "CMD" + // HealthConfigTestCmdShell runs commands with the system's default shell + HealthConfigTestCmdShell = "CMD-SHELL" +) diff --git a/libpod/healthcheck.go b/libpod/healthcheck.go index 95c70b60e..df6f00e7e 100644 --- a/libpod/healthcheck.go +++ b/libpod/healthcheck.go @@ -47,11 +47,11 @@ func (c *Container) runHealthCheck() (define.HealthCheckStatus, error) { return define.HealthCheckNotDefined, errors.Errorf("container %s has no defined healthcheck", c.ID()) } switch hcCommand[0] { - case "", "NONE": + case "", define.HealthConfigTestNone: return define.HealthCheckNotDefined, errors.Errorf("container %s has no defined healthcheck", c.ID()) - case "CMD": + case define.HealthConfigTestCmd: newCommand = hcCommand[1:] - case "CMD-SHELL": + case define.HealthConfigTestCmdShell: // TODO: SHELL command from image not available in Container - use Docker default newCommand = []string{"/bin/sh", "-c", strings.Join(hcCommand[1:], " ")} default: |