-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix handling of healthcheck from image #3539
Fix handling of healthcheck from image #3539
Conversation
Hi @stefanb2. Thanks for your PR. I'm waiting for a containers or openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
Can one of the admins verify this patch?
|
d52d0d0
to
d94fbca
Compare
d94fbca
to
f30eb45
Compare
/test special_testing_rootless |
f30eb45
to
6f0fdc6
Compare
That one's a known flake. For reference, the /retest commands don't work on most tests - you need to go into the page for the failing test, and click the restart link |
Tests with Docker V1 images, generated on Fedora 30 with default docker installation. F30 podman package rebuilt with WIP patches included.
Healthcheck disabled
Healthcheck with one command
Healthcheck with 1-element command list
Healthcheck with 2-element command list
Healthcheck with one command and non-default interval
Healthcheck with one command and non-default timeout
Healthcheck with one command and non-default retries
|
Tests with Docker V2 images, generated on Fedora 30 with Docker CE 19.03 installation. F30 podman package rebuilt with WIP patches included.
Healthcheck disabled
Healthcheck with one command
Healthcheck with 1-element command list
Healthcheck with 2-element command list
Healthcheck with one command and non-default interval
Healthcheck with one command and non-default timeout
Healthcheck with one command and non-default start period
Healthcheck with one command and non-default retries
|
6f0fdc6
to
5f700e1
Compare
From my PoV this PR is ready for final review & approval. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon, stefanb2 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5f700e1
to
f0c24e5
Compare
Healthcheck with empty command
i.e. podman does create the unit & timer, but any attempt to start the healthcheck is rejected by podman. Hence there are no attempts logged in the container and its health state stays at |
- remove duplicate check, already called in HealthCheck() - reject zero-length command list and empty command string as errorneous - support all Docker command list keywords: NONE, CMD or CMD-SHELL - use Docker default "/bin/sh -c" for CMD-SHELL Fixes containers#3507 Signed-off-by: Stefan Becker <chemobejk@gmail.com>
If the image doesn't provide any options, e.g. interval, timeout, etc., then apply the Docker defaults when creating the container. Otherwise the defaults will be left 0 and podman doesn't schedule the healtcheck service & timer for the container or incorrectly reports unhealthy state when the check is executed. Fixes containers#3525 Signed-off-by: Stefan Becker <chemobejk@gmail.com>
If the image was built with "HEALTHCHECK NONE" then we should create a container without healthcheck configuration. Otherwise executing the healthcheck on the container will return "unhealthy" instead of the correct error message that the container doesn't have a healthcheck. We also ignore the healthcheck configuration if the command list is empty or the command string is empty. Fixes containers#3525 Signed-off-by: Stefan Becker <chemobejk@gmail.com>
An image with "HEALTHCHECK CMD ['']" is valid but as there is no command defined the healthcheck will fail. Reject such a configuration. Fixes containers#3507 Signed-off-by: Stefan Becker <chemobejk@gmail.com>
f0c24e5
to
5ed2de1
Compare
Can I have a LGTM from the reviewers? |
LGTM |
@rhatdan @giuseppe @vrothberg PTAL |
/lgtm |
proposed fix for Does not schedule healthcheck for images with HEALTHCHECK #3525 cmd/podman/shared/create.go:
If the image doesn't provide any options, e.g. interval, timeout, etc.,
then apply the standard defaults when creating the container. Now podman
correctly schedules the healtcheck service & timer for the container.
proposed fix for podman incompatiblity with healthcheck from docker image #3507 libpod/healthcheck.go