-
Notifications
You must be signed in to change notification settings - Fork 14
engineering: Implement select_servicing_type()
#374
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
Changes from all commits
a188bd7
faa08c9
2d822ec
3ea52ec
3f6e7d8
9854092
3c339a8
78633a6
d43bb6d
742c336
7ed04b3
b6b7d7d
1a1eb8e
0d2566b
ca90f7a
8c802df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,17 @@ impl Subsystem for OsConfigSubsystem { | |
| REQUIRES_REBOOT | ||
| } | ||
|
|
||
| fn select_servicing_type(&self, ctx: &EngineContext) -> Result<ServicingType, TridentError> { | ||
| if ctx.spec.os != ctx.spec_old.os { | ||
| if runtime_update_sufficient(ctx) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Could this be a method of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a preference to keep the logic here so that subsystems that own parts of the HC can individually determine which servicing type is required
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't mean moving this func; I suggested defining it as a method of EngineContext by using the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it, sorry, based on the GitHub formatting I thought you were suggesting making |
||
| return Ok(ServicingType::RuntimeUpdate); | ||
| } else { | ||
| return Ok(ServicingType::AbUpdate); | ||
| } | ||
| } | ||
| Ok(ServicingType::NoActiveServicing) | ||
| } | ||
|
|
||
| fn validate_host_config(&self, ctx: &EngineContext) -> Result<(), TridentError> { | ||
| // If the os-modifier binary is required but not present, return an error. | ||
| if os_config_requires_os_modifier(ctx) && !Path::new(OS_MODIFIER_BINARY_PATH).exists() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,6 @@ use crate::engine::{EngineContext, Subsystem}; | |
|
|
||
| mod encryption; | ||
| mod fstab; | ||
| mod image; | ||
| mod osimage; | ||
| mod raid; | ||
| mod verity; | ||
|
|
@@ -151,23 +150,6 @@ impl Subsystem for StorageSubsystem { | |
| Ok(()) | ||
| } | ||
|
|
||
| fn select_servicing_type(&self, ctx: &EngineContext) -> Result<ServicingType, TridentError> { | ||
| // Any changes to the storage section of the Host Configuration require | ||
| // a Clean Install. | ||
| if ctx.spec_old.storage != ctx.spec.storage { | ||
| return Ok(ServicingType::CleanInstall); | ||
| } | ||
|
Comment on lines
-155
to
-159
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check is performed already inside |
||
|
|
||
| // If ab_update_required() returns true, A/B update is required. | ||
| if image::ab_update_required(ctx) | ||
| .message("Failed to determine if A/B update is required")? | ||
| { | ||
| return Ok(ServicingType::AbUpdate); | ||
| } | ||
|
|
||
| Ok(ServicingType::NoActiveServicing) | ||
| } | ||
|
|
||
| fn provision(&mut self, ctx: &EngineContext, mount_path: &Path) -> Result<(), TridentError> { | ||
| if ctx.servicing_type == ServicingType::CleanInstall | ||
| && ctx.storage_graph.root_fs_is_verity() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.