mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +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,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,
|
||||
|
Reference in New Issue
Block a user