Invert dependency between sled-agent-types and illumos-utils#10158
Merged
jgallagher merged 7 commits intomainfrom Mar 26, 2026
Merged
Invert dependency between sled-agent-types and illumos-utils#10158jgallagher merged 7 commits intomainfrom
sled-agent-types and illumos-utils#10158jgallagher merged 7 commits intomainfrom
Conversation
bnaecker
approved these changes
Mar 26, 2026
Collaborator
bnaecker
left a comment
There was a problem hiding this comment.
This is great! Much smaller than I feared.
| pub struct ZpoolHealthParseError(pub String); | ||
|
|
||
| // TODO-correctness `ZpoolHealth` implements both `FromStr` and `Display`, but | ||
| // they aren't symmetric - we should replace one of these (probably `FromStr`?) |
Collaborator
There was a problem hiding this comment.
I agree with replacing FromStr. That looks like it's parsing the CLI tool output format.
zeeshanlakhani
approved these changes
Mar 26, 2026
Collaborator
zeeshanlakhani
left a comment
There was a problem hiding this comment.
I do think this limits the complexity of solution #1. As we discussed in chat, its seems that much of illumos-utils (excepting zone naming) it mainly targeting the sled-agent context. Nonetheless, it seems like the original goals of illumos-utils was somewhat murky and that it was meant to be more general?
Nonetheless, this is a nice, focused PR, and helps us in the now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both @bnaecker and @zeeshanlakhani recently bumped into issues where the fact that
sled-agent-types-versionsdepends onillumos-utilscaused pain, because we needed to add or change types that are defined or consumed byillumos-utils, but those types appear in thesled-agentAPI and therefore also need to be versioned. We can't put them insled-agent-types-versionsbecause that creates a cycle between the two crates, but putting them inillumos-utilsmeans they can't (easily) be versioned.We talked about two possible solutions to this:
*-types-versions+*-typescrate that bothillumos-utilsandsled-agent-types-versionscan depend on. [multicast] M2P forwarding, OPTE port subscription, and sled-agent propagation #10070 starts down this path.illumos-utilscould depend onsled-agent-typesinstead of the other way around, we can put the types insled-agent-types-versionsas we'd prefer for versioned types.This PR implements the second of those, but I'm not totally sold it's the right way to go - maybe it would be cleaner to have a lower-level types crate shared by both. I did want to see how painful it was, and it wasn't too bad.
My gut feeling is that the changes here fall into three categories:
illumos-utilsand intosled-agent-types-versions, allowing them to be cleanly versioned in the future. (Svc,SvcState,ZpoolHealth)Fromimpls converting between illumos-utils types and sled-agent types now live inillumos-utilsinstead ofsled-agent-types-versions(AttachedSubnet,AttachedSubnetKind,SvcsResult,DatasetProperties)sled-agent-typesused functionality fromillumos_utilsthat didn't make sense to move wasOmicronZoneConfig::zone_name(), which calls a function inillumos_utilsto construct a zone name. I moved this to anOmicronZoneConfigExtextension trait defined byillumos_utils; I don't love this but on balance I think it's worth taking to get point 1?