podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

CMD-SHELL healthcheck passed as json array

Open doc-sheet opened this issue 6 months ago • 1 comments

Describe the bug Podman-compose passes 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 (1.4.0 like)

doc-sheet avatar Jun 28 '25 14:06 doc-sheet

Also invalid command generated for strings.

      healthcheck:
        test: redis-cli ping | grep PONG

has been turned to --healthcheck-command ["CMD-SHELL", "redis-cli ping | grep PONG"]

Instead of --healthcheck-command "redis-cli ping | grep PONG"

doc-sheet avatar Jun 28 '25 18:06 doc-sheet