-
Notifications
You must be signed in to change notification settings - Fork 116
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
Work around uuid file corruption in balenaEngine health check #3409
Conversation
1b0b38b
to
eab468d
Compare
# Check for all the possible formats, starting with the most common one, to | ||
# benefit from the short-circuited evaluation. The contents of the uuid file | ||
# must match these formats exactly, so we anchor the regexes both at the | ||
# beginning (^) and the end ($). |
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.
Love the detailed comments!
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 believe time travel is impossible, because otherwise I'd expect someone to have come back to thank me for those 😝
eab468d
to
4d17f0b
Compare
@resin-jenkins retest this please |
a09d9e0
to
1281755
Compare
@resin-jenkins retest this please |
1281755
to
9dbb95c
Compare
9dbb95c
to
2986278
Compare
We have detected one more way in which the uuid file used by containerd can get corrupted. This time, the file is not empty, but doesn't contain a valid UUID either. This commit thus extends the existing workaround to also handle this case. See balena-os/balena-engine#322 Signed-off-by: Leandro Motta Barros <[email protected]> Change-type: patch
2986278
to
e3696fc
Compare
@resin-jenkins retest this please |
We have detected one more way in which the uuid file used by containerd can get corrupted. This time, the file is not empty, but doesn't contain a valid UUID either.
This commit thus extends the existing workaround to also handle this case.
See balena-os/balena-engine#322
Testing
I tested this manually only. I built balenaOS for raspberrypi3-64 using my branch of meta-balena and flashed it to a device. Then I tried to manually change the contents of the
uuid
file and run the health check to see the results:uuid
file remained unchanged.uuid
file was created.In other words, no form of bad
uuid
should not cause the Engine healthcheck to fail after this change.Regarding automated tests: I believe it should be possible to add some automated test cases for that -- basically automate the kind of manual testing I described above. I am not so sure this would add significant value, though. (FWIW, we don't have automated tests for the current version of this workaround)
Contributor checklist
Change-type
present on at least one commitSigned-off-by
is presentReviewer Guidelines