summaryrefslogtreecommitdiff
path: root/cmd/podman/shared/create.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-02-22 10:19:11 -0600
committerBrent Baude <bbaude@redhat.com>2020-02-22 12:45:15 -0600
commit0184714a82696feec33b383bfd98875712173e6e (patch)
tree1cecbe40de371ac953f947170246160df279c727 /cmd/podman/shared/create.go
parent2850ec5f507ee6c3202f09e099b01a4e550ef0d9 (diff)
downloadpodman-0184714a82696feec33b383bfd98875712173e6e.tar.gz
podman-0184714a82696feec33b383bfd98875712173e6e.tar.bz2
podman-0184714a82696feec33b383bfd98875712173e6e.zip
Add --no-healthcheck command to create/run
Now support --no-healthcheck option to disable defined healthchecks in a container image. --health-cmd=none remains supported as well. Fixes: #5299 Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/shared/create.go')
-rw-r--r--cmd/podman/shared/create.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index 5b244699c..0814eeba3 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -120,12 +120,13 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod.
imageName = newImage.ID()
}
- // if the user disabled the healthcheck with "none", we skip adding it
+ // if the user disabled the healthcheck with "none" or the no-healthcheck
+ // options is provided, we skip adding it
healthCheckCommandInput := c.String("healthcheck-command")
// the user didn't disable the healthcheck but did pass in a healthcheck command
// now we need to make a healthcheck from the commandline input
- if healthCheckCommandInput != "none" {
+ if healthCheckCommandInput != "none" && !c.Bool("no-healthcheck") {
if len(healthCheckCommandInput) > 0 {
healthCheck, err = makeHealthCheckFromCli(c)
if err != nil {