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

[fio extras] storage: allow target to be marked as bad #77

Draft
wants to merge 3 commits into
base: 2024.03+fio
Choose a base branch
from

Conversation

detsch
Copy link
Member

@detsch detsch commented Dec 19, 2024

This feature is required to allow a rollback operation to be forced on a target whose installation was finished.

@detsch detsch requested a review from mike-sul December 19, 2024 16:18
detsch added 2 commits January 2, 2025 11:28
This feature is required to allow a rollback operation to be forced on
a target whose installation was finished.

Signed-off-by: Andre Detsch <andre.detsch@foundries.io>
An additional option is included to allow filtering out current target
from installed versions list.

This is required to properly select the a rollback target after
installation was finalized, and there was not ostree update, only apps.

Signed-off-by: Andre Detsch <andre.detsch@foundries.io>
@detsch detsch force-pushed the detsch-user-rollback branch from d29fafd to 7f8a23b Compare January 2, 2025 15:47
@@ -1118,6 +1118,17 @@ void SQLStorage::saveInstalledVersion(const std::string& ecu_serial, const Uptan
LOG_ERROR << "Failed to save installed versions: " << db.errmsg();
return;
}
} else if (update_mode == InstalledVersionUpdateMode::kBadTarget) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first glance, it looks like this if is better suited in the if else below before if (!!old_id).

if (update_mode == InstalledVersionUpdateMode::kBadTarget) {
...
} else if (!!old_id) {
...

What do you think?

When the virtual environment has a reboot pending, prioritize the use of
`is_current` from database, instead of forcing the use of a target that
matches the latest ostree hash.
This approximates the behavior to the one observed in actual devices
(booted mode) when there is a reboot pending after an install operation.

Signed-off-by: Andre Detsch <andre.detsch@foundries.io>
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