summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-03-06 09:24:22 -0800
committerGitHub <noreply@github.com>2019-03-06 09:24:22 -0800
commitc6c0b54c361df623378706ca5e41faac309ab7ac (patch)
tree3694ec6a3953469c7db115e2e00fb7e2a1ced003 /libpod/container.go
parent2b5a9628324c4d93769d72d3d8c85667eaac612a (diff)
parent598bde52d02eb82634c6b1fa357253f03120a4a0 (diff)
downloadpodman-c6c0b54c361df623378706ca5e41faac309ab7ac.tar.gz
podman-c6c0b54c361df623378706ca5e41faac309ab7ac.tar.bz2
podman-c6c0b54c361df623378706ca5e41faac309ab7ac.zip
Merge pull request #2491 from baude/healtcheckphase1
podman healthcheck run (phase 1)
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go
index 75f4a4a4f..2381f53ad 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -10,6 +10,7 @@ import (
"github.com/containernetworking/cni/pkg/types"
cnitypes "github.com/containernetworking/cni/pkg/types/current"
+ "github.com/containers/image/manifest"
"github.com/containers/libpod/libpod/lock"
"github.com/containers/libpod/pkg/namespaces"
"github.com/containers/storage"
@@ -365,6 +366,9 @@ type ContainerConfig struct {
// Systemd tells libpod to setup the container in systemd mode
Systemd bool `json:"systemd"`
+
+ // HealtchCheckConfig has the health check command and related timings
+ HealthCheckConfig *manifest.Schema2HealthConfig
}
// ContainerStatus returns a string representation for users
@@ -1085,3 +1089,14 @@ func (c *Container) ContainerState() (*ContainerState, error) {
deepcopier.Copy(c.state).To(returnConfig)
return c.state, nil
}
+
+// HasHealthCheck returns bool as to whether there is a health check
+// defined for the container
+func (c *Container) HasHealthCheck() bool {
+ return c.config.HealthCheckConfig != nil
+}
+
+// HealthCheckConfig returns the command and timing attributes of the health check
+func (c *Container) HealthCheckConfig() *manifest.Schema2HealthConfig {
+ return c.config.HealthCheckConfig
+}