Repository navigation
distro/defs: drop the ImageTypeYAML property from defs.imageType - #2685
Merged
Merged
Conversation
This commit moves everything from pkg/distro/generic/ into pkg/distro/defs/. Import paths have been adjusted throughout the project. The genManifest() function in bootc_test.go was rewritten to not depend on manifestgen since that creates an import cycle. The purpose of this change is to isolate any handling of image definition loading and mentions of YAML to one package, pkg/distro/defs/. In the end, loading functionality and all types initialised from the distro definitions will be defined in pkg/distro/defs/. YAML-specific types will be private and convert to internal types for handling. As much as possible, the properties of these types will be immutable. The GitLab CI config has been updated to test the new paths when explicitly tested.
The error was being silently ignored while returning an empty imageType.
achilleas-k
force-pushed
the
plug-the-yaml-leaks
branch
from
September 14, 2026 15:43
5355f2d to
5e7e466
Compare
Add properties to the imageType struct to hold all required information about the image type. These are not used right now, but will be set during initialisation instead of holding the ImageTypeYAML and using that indirectly.
Instead of embedding ImageTypeYAML in imageType, add it as a regular property. This makes it clear and explicit what gets accessed from the YAML backend and what's a property or method of the imageType itself. The goal is to remove all YAML-backed data and types from the imageType and resolve everything as soon as it's loaded, making the imageType as static as possible.
Set and get some of the simple string properties of the imageType directly from the imageType instead of the nested ImageTypeYAML. One of the goals of this refactoring is to minimise the amount of processing in the accessor methods. Anything that can be set statically during initialisation should be. The supported blueprint options are the first example of this. The appending of the three common/default metadata properties is added during initialisation instead of being part of the SupportedBlueprintOptions() method. One small change in behaviour: The Exports() method no longer returns ["assembler"] when the field is not set. That fallback mechanism was added to support image types configured to generate v1 manifests for osbuild, which haven't been relevant for a few years now.
The ErrNoPartitionTableForImgType requires the image type name as argument but we were setting the distro ID instead.
achilleas-k
force-pushed
the
plug-the-yaml-leaks
branch
from
September 14, 2026 15:59
5e7e466 to
696e165
Compare
Resolve the partition table for the given distro, architecture, and image type combination during image type initialisation and set it statically as a property on the imageType.
In the ostree URL accessor, there's no need to check if the image type is ostree-based. A non-ostree-based image will have an empty URL.
Render the ISO label and set it on the imageType during initialisation. The isoLabel on the image type is now a string instead of a function. The getISOLabelFunc() has been renamed to resolveISOLabel() and now takes a template and architecture name and renders the ISO label string.
Resolve the imageConfig, installerConfig, isoConfig, and diskConfig and set them on the imageType during initialisation.
Resolve the package sets and set them on the imageType during initialisaion.
Move the internal method up onto the imageType instead of relying on the ImageTypeYAML backend.
The newImageTypeFrom() function now initialises the imageType with fully static properties and doesn't rely on the YAML backend. Currently, this means that more work is done up front that may not be necessary. Image types are initialised and dynamic properties are resolved on startup rather than on-demand. However, future plans are for image types to be initialised dynamically in their entirety. This change makes the creation and usage of the defs.imageType type simpler. The ImageTypeYAML is now not visible outside of the defs package where it serves the loader. The bootcImageType still relies on embedding ImageTypeYAML for some methods.
achilleas-k
force-pushed
the
plug-the-yaml-leaks
branch
from
September 14, 2026 16:09
696e165 to
65155fc
Compare
Member
|
I think this will (hopefully) fit nicely with making it a bit more standardized when templates are resolved in the future. I'll take a look soon. |
supakeen
approved these changes
Sep 15, 2026
supakeen
left a comment
Member
There was a problem hiding this comment.
This ... is extremely clean for so many changes even if mostly mechanical.
achilleas-k
added a commit
to achilleas-k/osbuild-composer
that referenced
this pull request
Sep 17, 2026
Update the image-builder dependency. Some import paths needed adjustment due to osbuild/image-builder#2685.
achilleas-k
added a commit
to achilleas-k/osbuild-composer
that referenced
this pull request
Sep 18, 2026
Update the image-builder dependency. Some import paths needed adjustment due to osbuild/image-builder#2685.
avitova
pushed a commit
to osbuild/osbuild-composer
that referenced
this pull request
Sep 21, 2026
Update the image-builder dependency. Some import paths needed adjustment due to osbuild/image-builder#2685.
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.
The newImageTypeFrom() function now initialises the imageType with fully static properties and doesn't rely on the YAML backend.
Currently, this means that more work is done up front that may not be necessary. Image types are initialised and dynamic properties are resolved on startup rather than on-demand. However, future plans are for image types to be initialised dynamically in their entirety. This change makes the creation and usage of the defs.imageType type simpler.
The ImageTypeYAML is now not visible outside of the defs package where it serves the loader.
The bootcImageType still relies on embedding ImageTypeYAML for some methods. I'm planning on doing the same to the bootcImageType in a follow-up.
The first commit was originally #2675.