summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-27 11:21:53 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-27 11:21:55 +0200
commit350727570b6f033c5c509a62ec8bfc4827e1c2fc (patch)
tree8b6cb4d23d0450f8ea828fff79745d18047a6beb /cmd
parentefafd99e6d9e2555c2a167bc17d07629503a2c34 (diff)
downloadpodman-350727570b6f033c5c509a62ec8bfc4827e1c2fc.tar.gz
podman-350727570b6f033c5c509a62ec8bfc4827e1c2fc.tar.bz2
podman-350727570b6f033c5c509a62ec8bfc4827e1c2fc.zip
podman: special case health-cmd none
now we have to pass down this information to libpod Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/specgen.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 488843f41..ead67ee92 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -623,10 +623,15 @@ func makeHealthCheckFromCli(inCmd, interval string, retries uint, timeout, start
// first try to parse option value as JSON array of strings...
cmd := []string{}
- err := json.Unmarshal([]byte(inCmd), &cmd)
- if err != nil {
- // ...otherwise pass it to "/bin/sh -c" inside the container
- cmd = []string{"CMD-SHELL", inCmd}
+
+ if inCmd == "none" {
+ cmd = []string{"NONE"}
+ } else {
+ err := json.Unmarshal([]byte(inCmd), &cmd)
+ if err != nil {
+ // ...otherwise pass it to "/bin/sh -c" inside the container
+ cmd = []string{"CMD-SHELL", inCmd}
+ }
}
hc := manifest.Schema2HealthConfig{
Test: cmd,