Repository navigation
disk: keep part_* fields when decoding a partition from TOML - #57
Open
andrewdunndev wants to merge 2 commits into
Open
andrewdunndev wants to merge 2 commits into
andrewdunndev wants to merge 2 commits into
Conversation
PartitionCustomization.UnmarshalTOML never assigns `part_type`, `part_label` or `part_uuid`, so a partition decoded directly from TOML silently loses all three. UnmarshalJSON reads them next to `type` and `minsize` and assigns them once the payload is decoded; do the same in the TOML decoder. Blueprints are not affected, because DiskCustomization decodes its partitions through the JSON path. The fields came in with [1] and [2], which added the assignments to UnmarshalJSON only. The type assertions can ignore `ok`: decodePlain, decodeBtrfs and decodeLVM already reject a non-string value for these keys. [1]: osbuild/image-builder#1115 [2]: osbuild/image-builder#1543 Signed-off-by: Andrew Dunn <andrew@dunn.dev>
brlane-rht
requested changes
Oct 1, 2026
Plain stays the empty-case check; plain-with-parts covers the fields. Signed-off-by: Andrew Dunn <andrew@dunn.dev>
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.
Decoding a
PartitionCustomizationdirectly from TOML silently dropspart_type,part_labelandpart_uuid, because onlyUnmarshalJSONassigns them (osbuild/image-builder#1115, osbuild/image-builder#1543). This assigns them inUnmarshalTOMLtoo. Blueprints are not affected, sinceDiskCustomizationdecodes its partitions through JSON.Routing it through
unmarshalTOMLviaJSONinstead would also work, but changes the TOML error messages the tests pin. I found this while looking at aluksproperty for partitions (osbuild/image-builder#2609), which would hit the same gap.