Skip to content

Commit

Permalink
Decouple inventory and blueprint zone types (#6466)
Browse files Browse the repository at this point in the history
There should be no behavioral changes in this PR and it is solely a
refactoring for future ease of development.

When converting between DB types and omicron internal types for zones,
we previously had some common types shared between the inventory and
blueprint zones to help with the conversions because the commonality is
so great. However, blueprint zone types can contain extra, auxiliary
information to help with planning, and the conversion to the common
types required passing in extra values to the common constructor for the
blueprint types and then passing `None` for the inventory types.

Currently the only extra type contained in the blueprint types is an
`ExternalIpUuid`. However, as we expand the reconfigurator we anticipate
the blueprint gaining more auxiliary information and diverging further
from the inventory types. This is already starting to happen with the
replicated clickhouse zone types. Therefore, this PR removes the common
types altogether, except for the `OmicronZoneNic` type, and adds some
helper functions that can be used for both blueprint and inventory
conversions. The logic of these functions is largely copied over from
what was previously in the shared type generation code.
  • Loading branch information
andrewjstone authored Aug 28, 2024
1 parent aff73fc commit 57c3c75
Show file tree
Hide file tree
Showing 3 changed files with 868 additions and 724 deletions.
Loading

0 comments on commit 57c3c75

Please sign in to comment.