podman: special case health-cmd none

now we have to pass down this information to libpod

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-04-27 11:21:53 +02:00
parent efafd99e6d
commit 350727570b
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
1 changed files with 9 additions and 4 deletions

View File

@ -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,