Skip to content

[10/n] [sled-agent] validate zone images as written in mupdate-override dataset #8190

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

Open
wants to merge 4 commits into
base: sunshowers/spr/main.9n-wip-sled-agent-validate-zone-images-as-written-in-mupdate-override-dataset
Choose a base branch
from

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented May 20, 2025

Included in this PR:

  • Add validation for zone images
  • Write tests for success and failure cases
  • Extend the test_installinator_fetch wicketd integration test to also ensure installinator + sled-agent have a coherent view of the world

The last point forced me to expose a bunch of the status via a public interface. We'll be able to reuse this information (though probably not in this full form) and send it up as part of the inventory.

Depends on:

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the title [9/n] [wip] [sled-agent] validate zone images as written in mupdate-override dataset [10/n] [sled-agent] validate zone images as written in mupdate-override dataset May 29, 2025
Created using spr 1.3.6-beta.1
@sunshowers sunshowers marked this pull request as ready for review May 29, 2025 01:14
Created using spr 1.3.6-beta.1
@@ -61,7 +61,8 @@ struct ArtifactDestination {

impl ArtifactDestination {
fn from_directory(dir: &Utf8Path) -> Result<Self> {
let control_plane_dir = dir.join("zones");
// The install dataset goes into a directory called "install".
let control_plane_dir = dir.join("install");
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this just wrong before? (Hopefully only used by tests??)

pub boot_disk_override:
Result<Option<MupdateOverrideInfo>, MupdateOverrideReadError>,

/// Status of the non-boot disks. This results in warnings.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit / question - this only results in warnings in bad cases, right? The typical case is MatchesPresent which would not emit warnings?

)?;
}
ArtifactReadResult::Error(error) => {
writeln!(f, " {}: error ({})", artifact.file_name, error)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this print the whole error chain since ArtifactReadResult itself isn't an Error?

let artifacts =
MupdateOverrideArtifactsResult::new(dataset_dir, data);
if artifacts.is_valid() {
// If there are errors, return them as appropriate.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment in the wrong branch? If artifacts.is_valid(), there are no errors right?

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