summaryrefslogtreecommitdiff
path: root/libpod/healthcheck.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-22 22:46:18 +0200
committerGitHub <noreply@github.com>2019-07-22 22:46:18 +0200
commita12a2312ac5c6c485eaa1d45e4b7e29d6cc4a9ff (patch)
tree2fe83dbecabff2df6aabfe7204418fd6fa05919e /libpod/healthcheck.go
parentcf9efa90e5dcf89e10408eae5229c4ce904d9fc7 (diff)
parent53e1ede46b030ad2aeecbdd7b2a385b60500ac4c (diff)
downloadpodman-a12a2312ac5c6c485eaa1d45e4b7e29d6cc4a9ff.tar.gz
podman-a12a2312ac5c6c485eaa1d45e4b7e29d6cc4a9ff.tar.bz2
podman-a12a2312ac5c6c485eaa1d45e4b7e29d6cc4a9ff.zip
Merge pull request #3143 from haircommander/conmon-exec
use conmon for exec
Diffstat (limited to 'libpod/healthcheck.go')
-rw-r--r--libpod/healthcheck.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/libpod/healthcheck.go b/libpod/healthcheck.go
index 1a19b88bb..0338828e4 100644
--- a/libpod/healthcheck.go
+++ b/libpod/healthcheck.go
@@ -141,10 +141,18 @@ func (c *Container) runHealthCheck() (HealthCheckStatus, error) {
logrus.Debugf("executing health check command %s for %s", strings.Join(newCommand, " "), c.ID())
timeStart := time.Now()
hcResult := HealthCheckSuccess
- hcErr := c.Exec(false, false, []string{}, newCommand, "", "", streams, 0)
+ _, hcErr := c.Exec(false, false, []string{}, newCommand, "", "", streams, 0, nil, "")
if hcErr != nil {
+ errCause := errors.Cause(hcErr)
hcResult = HealthCheckFailure
- returnCode = 1
+ if errCause == define.ErrOCIRuntimeNotFound ||
+ errCause == define.ErrOCIRuntimePermissionDenied ||
+ errCause == define.ErrOCIRuntime {
+ returnCode = 1
+ hcErr = nil
+ } else {
+ returnCode = 125
+ }
}
timeEnd := time.Now()
if c.HealthCheckConfig().StartPeriod > 0 {