From a9f6592af6646d3692e8a7260df98dd606aa4d9b Mon Sep 17 00:00:00 2001 From: cdoern Date: Mon, 26 Jul 2021 09:05:05 -0400 Subject: Fixed Healthcheck formatting, string to []string Compat healthcheck tests are of the format []string but podman's were of the format string. Converted podman's to []string at the specgen level since it has the same effect and removed the incorrect parsing of compat healthchecks. fixes #10617 Signed-off-by: cdoern --- cmd/podman/common/create_opts.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd/podman/common/create_opts.go') diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index cca6399b7..42e0efe5d 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -521,7 +521,9 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c for _, str := range cc.Config.Healthcheck.Test { finCmd = finCmd + str + " " } - finCmd = finCmd[:len(finCmd)-1] + if len(finCmd) > 1 { + finCmd = finCmd[:len(finCmd)-1] + } cliOpts.HealthCmd = finCmd cliOpts.HealthInterval = cc.Config.Healthcheck.Interval.String() cliOpts.HealthRetries = uint(cc.Config.Healthcheck.Retries) -- cgit v1.2.3-54-g00ecf