Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all healthcheck options in Compose #780

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

recursiveribbons
Copy link

  • Added start_interval to the healthcheck block parser
  • Changed the healthcheck flags to the normalized podman flags

Copy link
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. It looks good.

Please add unit tests. See e.g. pytests/test_container_to_args.py for an example.

@recursiveribbons
Copy link
Author

(rebased branch onto main and force pushed)

@recursiveribbons
Copy link
Author

I'm not sure how to fix the unit test, as --health-startup-interval does not exist in podman 4.3.1, which is the version shipped with Debian Bookworm (latest version is 4.9.3)

Signed-off-by: Robin Syl <[email protected]>
@recursiveribbons
Copy link
Author

Do you actually want me to commit the entire formatted podman_compose.py file or just let the test fail?

also the pre-commit checks wants me to format 10 files so I'm not sure if I should

@@ -1032,12 +1029,12 @@ async def container_to_args(compose, cnt, detached=True):
podman_args.append("--no-healthcheck")
elif healthcheck_type == "CMD":
cmd_q = "' '".join([cmd_quote(i) for i in healthcheck_test])
podman_args.extend(["--healthcheck-command", "/bin/sh -c " + cmd_q])
podman_args.extend(["--health-cmd", "/bin/sh -c " + cmd_q])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think in CMD case this should be executed with /bin/sh prevents cases from working where there is no /bin/sh in the image like minimal images for Rust applications. I don't have docker to verify, but from the documentation, my understanding is that this is ran without shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants