Skip to content

manifest/raw_bootc: support subscription registration on first boot (HMS-10897)#2528

Merged
supakeen merged 3 commits into
osbuild:mainfrom
lucasgarfield:bootc-subscription
Jul 22, 2026
Merged

manifest/raw_bootc: support subscription registration on first boot (HMS-10897)#2528
supakeen merged 3 commits into
osbuild:mainfrom
lucasgarfield:bootc-subscription

Conversation

@lucasgarfield

Copy link
Copy Markdown
Contributor

Wire up customizations.subscription for bootc disk images (qcow2, ami, ...).
The shared subscriptionService() machinery now runs in the RawBootcImage
pipeline: it creates the first-boot registration unit in /etc (not /usr, which
is immutable ostree content) and reruns Insights collection on boot so the
console reflects the new commit hash after upgrades — same options the
standalone Subscription pipeline uses for ostree systems.

Only the disk variant is wired for now.

While in there, URI-backed file customizations now return a clear error at
manifest generation time — they were previously silently broken in this
pipeline (missing manifest source).

@lucasgarfield
lucasgarfield requested a review from a team as a code owner July 17, 2026 11:39
Comment thread pkg/manifest/raw_bootc.go Outdated
// insights on boot
InsightsOnBoot: true,
UnitPath: osbuild.EtcUnitPath,
PermissiveRHC: common.ValueOrEmpty(p.OSCustomizations.PermissiveRHC),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This isn't actually ever set right? Not a blocker but also just a no-op at the moment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct. I went ahead and added a comment (// no-op for now: manifestForDisk never sets OSCustomizations.PermissiveRHC) but we could probably also wire it up without too much effort.

supakeen
supakeen previously approved these changes Jul 17, 2026
@supakeen

Copy link
Copy Markdown
Member

Needs linter appeasement otherwise OK.

Comment thread pkg/manifest/raw_bootc.go Outdated
Comment thread pkg/manifest/raw_bootc.go Outdated
Comment thread pkg/manifest/raw_bootc_test.go
@brlane-rht

Copy link
Copy Markdown
Contributor

Is there a reason you didn't add this to PXE and ISO types?

@lucasgarfield

Copy link
Copy Markdown
Contributor Author

Is there a reason you didn't add this to PXE and ISO types?

I will do so in a follow-up. I’m still quite new to hacking on image-builder so I wanted to keep things simple for this pull request. Also, I don't really grok how the ISO works yet. 😉

@brlane-rht brlane-rht 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.

Looks good!

This only takes effect once callers populate
OSCustomizations.Subscription; see the follow-up commit.

Previously, the only source of inline data was Customizations.Files.
Now we also need to create inline sources for files needed for
subscription. For the sake of consistency with the OS pipeline in
os.go, we add an inlineData field to RawBootcImage. The getInline()
method just becomes a getter for the inlineData field. A new helper,
genFileStagesAndRecordInlineData(), roughly mirrors
(*OS).addStagesForAllFilesAndInlineData. Unlike the OS pipeline,
however, there is no fileRefs() implementation here, so the helper
returns an error for URI-backed files; previously these silently
produced a manifest referencing a source that was never defined.

In addition to files, the subscriptionService() function also enables
a service, so the subscription code block emits a systemd stage for
it.

For subscriptionServiceOptions, InsightsOnBoot creates a drop-in that
reruns Insights collection on every healthy boot so that after an
upgrade the console reflects the new commit hash (see a6ecc32).
UnitPath needs to be /etc/ because /usr/ is immutable.

For the most part, the tests attempt to mirror the relevant tests for
os.go.
Copy the requested subscription options into the image customizations in
manifestForDisk, so bootc disk images (qcow2, ami, ...) register on first
boot via the machinery added in the previous commit.
TestRawBootcPXE collected mkdir paths by hand. A previous commit
added collectMkdirPaths for the same job, so use it here too.
@supakeen
supakeen added this pull request to the merge queue Jul 22, 2026
Merged via the queue into osbuild:main with commit 846e8ea Jul 22, 2026
50 checks passed
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.

3 participants