mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
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:
@ -623,11 +623,16 @@ func makeHealthCheckFromCli(inCmd, interval string, retries uint, timeout, start
|
|||||||
|
|
||||||
// first try to parse option value as JSON array of strings...
|
// first try to parse option value as JSON array of strings...
|
||||||
cmd := []string{}
|
cmd := []string{}
|
||||||
|
|
||||||
|
if inCmd == "none" {
|
||||||
|
cmd = []string{"NONE"}
|
||||||
|
} else {
|
||||||
err := json.Unmarshal([]byte(inCmd), &cmd)
|
err := json.Unmarshal([]byte(inCmd), &cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// ...otherwise pass it to "/bin/sh -c" inside the container
|
// ...otherwise pass it to "/bin/sh -c" inside the container
|
||||||
cmd = []string{"CMD-SHELL", inCmd}
|
cmd = []string{"CMD-SHELL", inCmd}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
hc := manifest.Schema2HealthConfig{
|
hc := manifest.Schema2HealthConfig{
|
||||||
Test: cmd,
|
Test: cmd,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user