-
Notifications
You must be signed in to change notification settings - Fork 146
[Feature] Add function to write reboot-required #1592
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
Conversation
crates/lib/src/deploy.rs
Outdated
| // Unconditionally create or update /run/reboot-required to signal a reboot is needed. | ||
| // This is monitored by kured (Kubernetes Reboot Daemon). | ||
| let reboot_message = format!("bootc: Reboot required for image: {}", &spec.image.image); | ||
| write_reboot_required(&image.manifest_digest.as_ref(), bootc_action.as_str())?; |
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.
This change from &spec.image.image to the manifest_digest is intentional to conform with the standard established by:
bootc/crates/lib/src/deploy.rs
Lines 851 to 852 in 39b0a32
| "Rolling back to image: {}", | |
| rollback_image.manifest_digest |
Which results in:
❯ journalctl --no-pager | grep -i rolling
Sep 06 16:46:43 fedora .tmpuGbC3K[51776]: Rolling back to image: sha256:465668e4bea0d739e2a0553ca826ce2c34f398293b64b3ad3a440c412fd22c93
This is technically more informative than the image name, particularly when tags are used instead of the digest. So the result of this change in the reboot-required file is:
❯ cat /run/reboot-required
bootc rollback: Reboot required for image: sha256:465668e4bea0d739e2a0553ca826ce2c34f398293b64b3ad3a440c412fd22c93
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.
Is there any specification for this file? Everything I can find shows tooling just checking for its presence. If it can contain freeform text, why not have multiple lines?
And if we can have multiple lines we can just render it like:
bootc: Reboot required for:
<current human readable status for a deployment>
right?
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 don't think there is a spec for this file tbh. I could only find a bunch of mailing list discussions, but nothing that appeared to establish a standard per se. It seems like this file is often created via touch /run/reboot-required in a package script, rather than applications doing it.
Maybe we're best just keeping the single line.
52543c2 to
a01ce3d
Compare
|
Outcome of this change:
And for |
a01ce3d to
57b86ba
Compare
|
hmm, I'll have to figure out if this is somehow related to my change: Leaving it in draft until I have time to look into that |
crates/lib/src/deploy.rs
Outdated
| // Unconditionally create or update /run/reboot-required to signal a reboot is needed. | ||
| // This is monitored by kured (Kubernetes Reboot Daemon). | ||
| let reboot_message = format!("bootc: Reboot required for image: {}", &spec.image.image); | ||
| write_reboot_required(&image.manifest_digest.as_ref(), bootc_action.as_str())?; |
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.
Is there any specification for this file? Everything I can find shows tooling just checking for its presence. If it can contain freeform text, why not have multiple lines?
And if we can have multiple lines we can just render it like:
bootc: Reboot required for:
<current human readable status for a deployment>
right?
|
Oops thought my last comment got lost, but it didn't... |
It's a preexisting flake, I'll file an issue. I restarted the test and it worked. |
This change adds a function that writes the /run/reboot-required file. This function is called from any deployment operation with the relevant context about the image that has been staged. This expands on the functionality requested in: bootc-dev#1574 Related to: bootc-dev#1583 Signed-off-by: Brendan Shephard <[email protected]>
57b86ba to
67008d5
Compare
This change adds a function that writes the /run/reboot-required file.
This function is called from any deployment operation with the relevant
context about the image that has been staged.
This expands on the functionality requested in: #1574
Related to: #1583