containers / containers/podman-compose

CMD-SHELL healthcheck passed as json array

Open
#1,256 1 comment 2 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Podman-compose [passes](https://github.com/containers/podman-compose/blob/8eb55735e95ee1587d0d22582aa86b9175e25ca9/podman_compose.py#L1293) CMD-SHELL healthcheck as json array instead of string
as

**To Reproduce**
Add healthcheck like
```
healthcheck:
test: [
"CMD-SHELL",
"http_proxy='' wget -nv -t1 --spider 'http://localhost:8123/' || exit 1",
]
```

**Expected behavior**
According to podman 3.4.4 documentation
>Multiple options can be passed in the form of a JSON array; otherwise, the command will be interpreted as an argument to /bin/sh -c.

```
--healthcheck-command http_proxy='' wget -nv -t1 --spider 'http://localhost:8123/' || exit 1
```

**Actual behavior**
```
--healthcheck-command ["http_proxy='' wget -nv -t1 --spider 'http://localhost:8123/' || exit 1"]
```

Btw documented command is `--health-cmd` at least for 3.4.4

**Output**

Podman-compose from [current master](https://github.com/containers/podman-compose/blob/8eb55735e95ee1587d0d22582aa86b9175e25ca9/podman_compose.py#L42) (1.4.0 like)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.