diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-03-06 09:24:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-06 09:24:22 -0800 |
commit | c6c0b54c361df623378706ca5e41faac309ab7ac (patch) | |
tree | 3694ec6a3953469c7db115e2e00fb7e2a1ced003 /libpod/options.go | |
parent | 2b5a9628324c4d93769d72d3d8c85667eaac612a (diff) | |
parent | 598bde52d02eb82634c6b1fa357253f03120a4a0 (diff) | |
download | podman-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/options.go')
-rw-r--r-- | libpod/options.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index 1e8592a25..5ad2824d9 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -7,6 +7,7 @@ import ( "regexp" "syscall" + "github.com/containers/image/manifest" "github.com/containers/libpod/pkg/namespaces" "github.com/containers/storage" "github.com/containers/storage/pkg/idtools" @@ -1469,3 +1470,14 @@ func WithInfraContainerPorts(bindings []ocicni.PortMapping) PodCreateOption { return nil } } + +// WithHealthCheck adds the healthcheck to the container config +func WithHealthCheck(healthCheck *manifest.Schema2HealthConfig) CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return ErrCtrFinalized + } + ctr.config.HealthCheckConfig = healthCheck + return nil + } +} |