Skip to content
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

Merged
merged 5 commits into from
May 31, 2019
Merged

Conversation

lucab
Copy link
Contributor

@lucab lucab commented May 29, 2019

This adds support for finalizing an OS update.

pub fn finalize_deployment(release: Release) -> Fallible<Release> {
let cmd = std::process::Command::new("rpm-ostree")
.arg("finalize-deployment")
.arg(release.reference_id())
Copy link
Member

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.

Copy link
Contributor Author

@lucab lucab May 29, 2019

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))
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

lucab added 4 commits May 31, 2019 09:14
This fixes some confusion between "upgrade" and "deploy" rpm-ostree verbs.
This adds support for finalizating an OS update.
@lucab
Copy link
Contributor Author

lucab commented May 31, 2019

@jlebon comments addressed, PTAL.

@lucab lucab merged commit b344bce into coreos:master May 31, 2019
@lucab lucab deleted the ups/finalize branch May 31, 2019 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants