From 03716cf7f331fa5b5ffab23dcc863bedd66b5dfc Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 6 Mar 2019 12:12:35 -0600 Subject: healtcheck phase 2 integration of healthcheck into create and run as well as inspect. healthcheck enhancements are as follows: * add the following options to create|run so that non-docker images can define healthchecks at the container level. * --healthcheck-command * --healthcheck-retries * --healthcheck-interval * --healthcheck-start-period * podman create|run --healthcheck-command=none disables healthcheck as described by an image. * the healthcheck itself and the healthcheck "history" can now be observed in podman inspect * added the wiring for healthcheck history which logs the health history of the container, the current failed streak attempts, and log entries for the last five attempts which themselves have start and stop times, result, and a 500 character truncated (if needed) log of stderr/stdout. The timings themselves are not implemented in this PR but will be in future enablement (i.e. next). Signed-off-by: baude --- pkg/spec/createconfig.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkg/spec/createconfig.go') diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index 6e7b297d2..a61c88d58 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -87,7 +87,6 @@ type CreateConfig struct { Env map[string]string //env ExposedPorts map[nat.Port]struct{} GroupAdd []string // group-add - HasHealthCheck bool HealthCheck *manifest.Schema2HealthConfig HostAdd []string //add-host Hostname string //hostname @@ -562,7 +561,7 @@ func (c *CreateConfig) GetContainerCreateOptions(runtime *libpod.Runtime, pod *l // Always use a cleanup process to clean up Podman after termination options = append(options, libpod.WithExitCommand(c.createExitCommand())) - if c.HasHealthCheck { + if c.HealthCheck != nil { options = append(options, libpod.WithHealthCheck(c.HealthCheck)) logrus.Debugf("New container has a health check") } -- cgit v1.2.3-54-g00ecf