-
Notifications
You must be signed in to change notification settings - Fork 36
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
update_agent: add update finalization #23
Conversation
src/rpm_ostree/cli_finalize.rs
Outdated
pub fn finalize_deployment(release: Release) -> Fallible<Release> { | ||
let cmd = std::process::Command::new("rpm-ostree") | ||
.arg("finalize-deployment") | ||
.arg(release.reference_id()) |
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.
Though here, it expects the checksum, not a revision=$checksum
. Offhand, I'd just drop the reference_id()
thing and do the format!()
directly in locked_upgrade()
. Really, that special syntax is available just for deploy
and rebase
.
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.
Good catch. I guess I was assuming that the input parsing was uniform across verbs. I'll undo the helper as you suggested.
.rpm_ostree_actor | ||
.send(msg) | ||
.flatten() | ||
.map_err(|e| log::error!("failed to finalize update: {}", e)) |
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.
So let's say it fails (either because of the reboot race, in which case it doesn't matter much, OR because it actually couldn't finalize), will the state machine stay in the UpdateStaged
state and retry on the next tick?
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.
Yes, as we would still be returning an error (of type ()
). This is just doing error-type mapping, in order to log error messages without the caller caring about the details. The future chained after this (via a map()
) will only run on success.
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.
Gotcha, thanks! Didn't mean to call out this specific line. Just confirming my understanding at a high level.
This fixes some confusion between "upgrade" and "deploy" rpm-ostree verbs.
This adds support for finalizating an OS update.
@jlebon comments addressed, PTAL. |
This adds support for finalizing an OS update.