summaryrefslogtreecommitdiff
path: root/pkg/spec
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-02-26 20:54:57 -0600
committerbaude <bbaude@redhat.com>2019-03-05 14:03:55 -0600
commit598bde52d02eb82634c6b1fa357253f03120a4a0 (patch)
tree08c935792c9e1d57ee00f8db98b3f1a74987f4b6 /pkg/spec
parent645426fe797f90fc75712388e0373158f13bab0a (diff)
downloadpodman-598bde52d02eb82634c6b1fa357253f03120a4a0.tar.gz
podman-598bde52d02eb82634c6b1fa357253f03120a4a0.tar.bz2
podman-598bde52d02eb82634c6b1fa357253f03120a4a0.zip
podman healthcheck run (phase 1)
Add the ability to manually run a container's healthcheck command. This is only the first phase of implementing the healthcheck. Subsequent pull requests will deal with the exposing the results and history of healthchecks as well as the scheduling. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/spec')
-rw-r--r--pkg/spec/createconfig.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index 31039bfdf..6e7b297d2 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -9,6 +9,7 @@ import (
"strings"
"syscall"
+ "github.com/containers/image/manifest"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/pkg/namespaces"
"github.com/containers/libpod/pkg/rootless"
@@ -86,6 +87,8 @@ 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
Image string
@@ -559,6 +562,10 @@ 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 {
+ options = append(options, libpod.WithHealthCheck(c.HealthCheck))
+ logrus.Debugf("New container has a health check")
+ }
return options, nil
}