Skip to content

many: bootc deployment variants - #2636

Open
supakeen wants to merge 3 commits into
osbuild:mainfrom
supakeen:bootc-variants
Open

many: bootc deployment variants#2636
supakeen wants to merge 3 commits into
osbuild:mainfrom
supakeen:bootc-variants

Conversation

@supakeen

@supakeen supakeen commented Sep 1, 2026

Copy link
Copy Markdown
Member

Implementation of #2566; I've left the path to be under /usr/lib/image-builder/bootc as I don't want to change the path again and we don't have a use case for package based trees yet.

Commits should be self explanatory see the issue for the reasoning.

Add deployment variant support to osinfo config loading. When a variant
name is provided we look in `<prefix>/variant.d/<name>` and fall back to
the default path if it doesn't exist. See [1].

[1]: osbuild#2566

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Variant parameter for `Container.ResolveInfo()` and
`ResolveBootcInfo()`. Also allow for resolving available variants from a
given container reference.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
@supakeen
supakeen requested a review from a team as a code owner September 1, 2026 06:12
Allow passing `--bootc-variant` to `bootc` relevant commands to select a
variant. Also add `bootc variants` to list variants available in a given
reference.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>

@lucasgarfield lucasgarfield left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty easy for me to follow so I suppose that means it's pretty nice. 😅

Only one real concern.

I could imagine a bit more test coverage but am not yet up to speed on the repo's conventions so I'm not asking for extra coverage - I'd be curious for you to comment on it, though, just for my own information.

Comment thread pkg/bib/osinfo/osinfo.go
}

func readDiskYaml(fsys fs.FS) (*diskYAML, error) {
func readDiskYaml(fsys fs.FS, variant string) (*diskYAML, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now a default disk.yaml in the image-builder prefix takes precedence over a variant disk.yaml in the bootc-image-builder prefix. This feels like a bug, since it means that bootc variants can list name(s) that --bootc-variant won't actually end up using.

e.g. imagine you have

/usr/lib/image-builder/bootc/disk.yaml
and
/usr/lib/bootc-image-builder/variant.d/btrfs/disk.yaml

It would return as soon as it found /usr/lib/image-builder/bootc/disk.yaml, ignoring the btrfs variant.

Should be an easy fix – just invert the nesting so we loop over [variant, default] on the outside and searchPaths on the inside.

@supakeen supakeen Sep 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree with the solution. What you describe is indeed the behavior but I think mixing two different prefixes and trying to merge them could maybe be wrong-er here. That said: we document that the new prefix takes precedence over the old one 1 so it isn't super weird that if a disk.yaml exists in that prefix that it wins over anything in the compatibility prefix.

What we should (probably) start doing is to emit a warning when we detect a container that has files in the old prefix path. I've filed 2 for this.

As for how to solve this with the above in mind I think there are three options:

  1. Leave as-is.
  2. Don't use both prefixes for any variant handling only /usr/lib/image-builder.
  3. Adjust ListVariants to not continue to the compatibility prefix when /usr/lib/image-builder exists.

What has your preference? For me it's the the last one and we could probably apply it to all cases where we check both prefixes.

@supakeen supakeen Sep 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I initially thought that merging the variants across prefixes was nice (it even has a test!) but your comment made me reconsider 🙂.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2648 for the warnings. #2649 for never falling back in general.

Comment thread pkg/bib/osinfo/osinfo.go
}

func readISOYaml(fsys fs.FS) (*isoYAML, error) {
func readISOYaml(fsys fs.FS, variant string) (*isoYAML, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as readDiskYaml above.

@supakeen

supakeen commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

I could imagine a bit more test coverage but am not yet up to speed on the repo's conventions so I'm not asking for extra coverage - I'd be curious for you to comment on it, though, just for my own information.

What test coverage would you like to see? It has a bunch of unit tests for the variant YAML finding but no actual build tests.

Integration tests on the manifest generation? To /me/ it feels like overkill but I am known to avoid them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants