aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/common/create_opts.go
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2021-07-26 09:05:05 -0400
committercdoern <cdoern@redhat.com>2021-07-26 16:58:38 -0400
commitfd1f57b3a667f69bb2ae424ec7a7735ef8f1fda4 (patch)
treed403ecdec13e912e980b01133f0ae995ce55f4cf /cmd/podman/common/create_opts.go
parentbef1f03d3ca8bfd90f4cbb295d99bf97df74a815 (diff)
downloadpodman-fd1f57b3a667f69bb2ae424ec7a7735ef8f1fda4.tar.gz
podman-fd1f57b3a667f69bb2ae424ec7a7735ef8f1fda4.tar.bz2
podman-fd1f57b3a667f69bb2ae424ec7a7735ef8f1fda4.zip
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 <cdoern@redhat.com>
Diffstat (limited to 'cmd/podman/common/create_opts.go')
-rw-r--r--cmd/podman/common/create_opts.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index 66778f519..cca6399b7 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -517,7 +517,12 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c
cliOpts.OOMKillDisable = *cc.HostConfig.OomKillDisable
}
if cc.Config.Healthcheck != nil {
- cliOpts.HealthCmd = strings.Join(cc.Config.Healthcheck.Test, " ")
+ finCmd := ""
+ for _, str := range cc.Config.Healthcheck.Test {
+ finCmd = finCmd + str + " "
+ }
+ finCmd = finCmd[:len(finCmd)-1]
+ cliOpts.HealthCmd = finCmd
cliOpts.HealthInterval = cc.Config.Healthcheck.Interval.String()
cliOpts.HealthRetries = uint(cc.Config.Healthcheck.Retries)
cliOpts.HealthStartPeriod = cc.Config.Healthcheck.StartPeriod.String()