-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
HealthCheck run one test #23982
HealthCheck run one test #23982
Conversation
Signed-off-by: Jan Rodák <[email protected]>
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Honny1 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
||
run_podman healthcheck run $ctrname | ||
run_podman inspect $ctrname --format "{{.State.Health.Log}}" >&3 | ||
[ $(echo "$output" | grep -o "Hi" - | wc -l) -eq 1 ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use this form of testing in bats. I know it's what the bats people themselves use, but it makes for impossible-to-understand error messages.
Actually, gimme a few more minutes, I'm not sure I understand the purpose of this PR. I think it can be refactored further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to figure out why the first time the podma healthcheck run
command is run, two log entries are created. I am unable to reproduce this on the local machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Honny1 I haven't looked deeply what you are doing but when you run podman run it will create and start the systemd timer right away which fires of the first healtcheck run so if you then manually run podman healthcheck run again you get a second run, this of course depends on the systemd
e.g.
$ bin/podman run --name c1 --health-cmd "echo hi" -d quay.io/libpod/testimage:20240123 sleep 100 && bin/podman healthcheck run c1 && podman inspect c1 --format "{{json .State.Health}}"
11249e7dcbd93e62e2e3d6af75be1664cc7961e2c340e5df53ab932442ba03c4
{"Status":"healthy","FailingStreak":0,"Log":[{"Start":"2024-09-17T18:55:11.63495862+02:00","End":"2024-09-17T18:55:11.730240069+02:00","ExitCode":0,"Output":"hi\n"},{"Start":"2024-09-17T18:55:11.676075091+02:00","End":"2024-09-17T18:55:11.753759388+02:00","ExitCode":0,"Output":"hi\n"}]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks that explains everything.
Does this PR introduce a user-facing change?