File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed
crates/lib/src/bootc_composefs Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -712,21 +712,22 @@ pub(crate) async fn composefs_deployment_status_from(
712712 . map ( |menu| menu. get_verity ( ) ) ,
713713 )
714714 . collect :: < Result < HashSet < _ > > > ( ) ?;
715- for entry in extra_deployment_boot_entries {
716- // SAFETY: boot_entry.composefs will always be present
717- let verity = & entry. composefs . as_ref ( ) . unwrap ( ) . verity ;
718- if bootloader_configured_verity. contains ( verity) {
719- match host. status . rollback {
720- Some ( ref _entry) => {
721- anyhow:: bail!(
722- "Multiple extra entires in /boot, could not determine rollback entry"
723- ) ;
724- }
725- None => {
726- host. status . rollback = Some ( entry) ;
727- }
728- }
729- }
715+ let rollback_candidates: Vec < _ > = extra_deployment_boot_entries
716+ . into_iter ( )
717+ . filter ( |entry| {
718+ let verity = & entry
719+ . composefs
720+ . as_ref ( )
721+ . expect ( "composefs is always Some for composefs deployments" )
722+ . verity ;
723+ bootloader_configured_verity. contains ( verity)
724+ } )
725+ . collect ( ) ;
726+
727+ if rollback_candidates. len ( ) > 1 {
728+ anyhow:: bail!( "Multiple extra entries in /boot, could not determine rollback entry" ) ;
729+ } else if let Some ( rollback_entry) = rollback_candidates. into_iter ( ) . next ( ) {
730+ host. status . rollback = Some ( rollback_entry) ;
730731 }
731732
732733 host. status . rollback_queued = is_rollback_queued;
You can’t perform that action at this time.
0 commit comments