-
Notifications
You must be signed in to change notification settings - Fork 51
[installinator] add support for fetching an installinator document #8733
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
[installinator] add support for fetching an installinator document #8733
Conversation
Created using spr 1.3.6-beta.1
impl ArtifactsToDownload { | ||
pub(crate) fn host_phase_2_id(&self) -> ArtifactHashId { | ||
ArtifactHashId { | ||
kind: ArtifactKind::HOST_PHASE_2, | ||
hash: self.host_phase_2, | ||
} | ||
} | ||
|
||
Ok(InstallinatorImageId { update_id, host_phase_2, control_plane }) | ||
pub(crate) fn control_plane_id(&self) -> ArtifactHashId { | ||
ArtifactHashId { | ||
kind: KnownArtifactKind::ControlPlane.into(), | ||
hash: self.control_plane, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of ArtifactKind
vs KnownArtifactKind
looks weirdly asymmetric
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it definitely is, though this just moves existing code.
if !missing.is_empty() { | ||
bail!( | ||
"installinator document missing \ | ||
required artifacts: {:?}", | ||
missing | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any advantage to trying to return an error over bail!
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, not quite sure what you mean here -- bail!
does return an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if there was a nicer way to handle the error than system exit but I've done a little more looking at installinator now and just exiting makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is within the context of a single update-engine step, so it's not an immediate system exit -- installinator will report this up to wicketd before exiting.
I have not yet read through the changes but I want to make sure that the installinator doc is still being treated as an artifact by Nexus (even if it doesn't have any specific instructions for what to do with it) and is being replicated into the repo depot. I don't remember where we landed on the sled recovery workflow but if it's Nexus-driven it will need to have the artifact around. |
Also uploaded the repo to Nexus and verified that the update dataset has the corresponding hash. All right, this is ready to review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for doing this!
@@ -503,7 +509,7 @@ mod tests { | |||
.await?; | |||
|
|||
// `by_id` should contain one entry for every `KnownArtifactKind` | |||
// (except `ControlPlane`). | |||
// (except `Zone`), as well as `installinator_document`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this changed from ControlPlane
to Zone
, guessing outdated comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thanks!
Created using spr 1.3.6-beta.1
Prepare for future work where we're going to transmit other kinds of artifacts over the wire to installinator -- not just host phase 2 and control plane.
For compatibility, installinator supports repos both with and without this document. In the future we can clean this up.
TODO:
Depends on: