diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-04-27 11:21:53 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-04-27 11:21:55 +0200 |
commit | 350727570b6f033c5c509a62ec8bfc4827e1c2fc (patch) | |
tree | 8b6cb4d23d0450f8ea828fff79745d18047a6beb /cmd/podman/common | |
parent | efafd99e6d9e2555c2a167bc17d07629503a2c34 (diff) | |
download | podman-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/podman/common')
-rw-r--r-- | cmd/podman/common/specgen.go | 13 |
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, |