Skip to content

[2/n] [reconfigurator-planning] avoid wiping out boot partition state#8937

Merged
sunshowers merged 4 commits into
mainfrom
sunshowers/spr/2n-reconfigurator-planning-avoid-wiping-out-boot-partition-state
Aug 29, 2025
Merged

[2/n] [reconfigurator-planning] avoid wiping out boot partition state#8937
sunshowers merged 4 commits into
mainfrom
sunshowers/spr/2n-reconfigurator-planning-avoid-wiping-out-boot-partition-state

Conversation

@sunshowers

Copy link
Copy Markdown
Contributor

The boot partition state is going to become important in tests soon, since we want to set up the simulated system such that no MGS-driven updates are happening. Simply calling debug_assume_success wipes out MGS-related state, so add an alternative that doesn't.

Created using spr 1.3.6-beta.1
RemoveMupdateOverrideBootSuccessInventory::Removed,
),
non_boot_message: "mupdate override successfully removed \
on non-boot disks"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Formatting got a little off here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed, thanks!

/// look at the actual `last_reconciliation` value from the parent
/// [`Inventory`].
pub fn debug_update_assume_success(&mut self, config: OmicronSledConfig) {
let external_disks = config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is most of this basically identical to debug_assume_success()? I wonder if debug_assume_success() could call this function internally to avoid the duplication; untested but something like

let mut inv = Self {
    // these fields will be filled in by `debug_update_assume_success()`
    last_reconciled_config: OmicronSledConfig::default(),
    external_disks: BTreeMap::default(),
    datasets: BTreeMap::default(),
    orphaned_datasets: IdOrdMap::default(),
    zones: BTreeMap::default(),
    remove_mupdate_override: None,

    // these fields will not
    boot_partitions: BootPartitionContents::debug_assume_success(),
};

inv.debug_update_assume_success(config);

inv

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) August 28, 2025 17:58
@sunshowers sunshowers merged commit 93c7b0b into main Aug 29, 2025
16 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/2n-reconfigurator-planning-avoid-wiping-out-boot-partition-state branch August 29, 2025 06:59
jgallagher added a commit that referenced this pull request Aug 29, 2025
This was a not-visible-to-git conflict between #8937 and #8940.
jgallagher added a commit that referenced this pull request Aug 29, 2025
This was a not-visible-to-git conflict between #8937 and #8940.

Fixes #8956
iliana pushed a commit that referenced this pull request Sep 2, 2025
…#8937)

The boot partition state is going to become important in tests soon,
since we want to set up the simulated system such that no MGS-driven
updates are happening. Simply calling `debug_assume_success` wipes out
MGS-related state, so add an alternative that doesn't.
iliana pushed a commit that referenced this pull request Sep 2, 2025
This was a not-visible-to-git conflict between #8937 and #8940.

Fixes #8956
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