Skip to content

Customization: Add a empty boolean to ignition#46

Merged
supakeen merged 1 commit intoosbuild:mainfrom
jbtrystram:ignition-firstboot-enable
Feb 25, 2026
Merged

Customization: Add a empty boolean to ignition#46
supakeen merged 1 commit intoosbuild:mainfrom
jbtrystram:ignition-firstboot-enable

Conversation

@jbtrystram
Copy link
Contributor

Add a simple enable bool to allow trigerring the osbuild stage without any parameters. This is used for CoreOS where we only need that file to exist in /boot without caring about the content.

Obviously, this boolean will be set to true if an URL is given. See https://issues.redhat.com/browse/HMS-10227

jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 23, 2026
This allow setting a `Firstboot.Ignition.Enable` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
@supakeen supakeen self-assigned this Feb 23, 2026
@supakeen supakeen self-requested a review February 23, 2026 15:28
supakeen
supakeen previously approved these changes Feb 23, 2026
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

You can undraft this one. The change is minor and a precondition to your change in images.

There's no real good solution here in regards to the boolean since historically we've used the 'non-empty URL' as meaning something is enabled (but now we want to enable without a URL) so just handling it in images would be perfectly fine to me 🙂

@jbtrystram jbtrystram marked this pull request as ready for review February 23, 2026 15:54
@jbtrystram jbtrystram requested a review from a team as a code owner February 23, 2026 15:54

type FirstBootIgnitionCustomization struct {
ProvisioningURL string `json:"url,omitempty" toml:"url,omitempty"`
Enable bool `json:"enable,omitempty" toml:"enable,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, this will default to false, no? So all existing blueprints would have to be updated to set enable = true.

Copy link
Member

@supakeen supakeen Feb 24, 2026

Choose a reason for hiding this comment

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

Depends how we handle this in images. If we consider the passing of ProvisioningURL to mean that things are enabled then pre-existing blueprints don't need to change and we only grow a new capability (enabling firstboot without a provisioning URL).

The companion PR in images seems to do exactly that: osbuild/images#2222 and the PR description mentions doing so explicitly as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@achilleas-k achilleas-k Feb 24, 2026

Choose a reason for hiding this comment

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

The description says it'll enable automatically if a URL is given, so I guess the behaviour would be the same for any existing blueprint.

It's a bit of a weird option in general though. I get the backstory and I understand the behaviour, but that's because I know where this came from and why the PR was made. But having a story or need for an option doesn't make it good UI design. We're adding this now to enable the scenario where you don't want a provisioning URL but want the file on disk, so:

  • ProvisioningURL = "" and Enable = true

But the change introduces more combinations:

  • ProvisioningURL = "$url" and explicitly setting Enable = false wouldn't do what the user expects if they're interpreting the word Enable without understanding the reason behind its introduction. You might say there's no reason to set a URL and not enable the customization, it doesn't make sense, so why would anyone do that? To which I'd say, why does the configuration format support it?

Perhaps this can be solved a different way. My mind jumps to having a keyword for the provisioning URL that is clearly not a URL, like [DEFAULT] or [EMPTY], but magic strings aren't much of an improvement. We could change the name of the new option to convey it's meaning better. Something like CreateDefault or CreateEmpty (or just default = true or empty = true) and make the option be mutually exclusive with provisioning_url.

This comment was marked as off-topic.

Copy link
Member

Choose a reason for hiding this comment

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

I think I quite like @achilleas-k's idea of renaming the option to empty and making it mutually exclusive with provisioning_url.

You could add validation to GetIgnition() to enforce that: https://github.com/osbuild/blueprint/blob/main/pkg/blueprint/customizations.go#L337-L342.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps this can be solved a different way.

The most intuitive approach would be to allow an empty string for ProvisionningUrl and write nothing in the file IMHO

Copy link
Member

Choose a reason for hiding this comment

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

Right, it'd be possible to change it to a pointer so we can differentiate. I'll let @achilleas-k / @croissanne chime in.

Personally I prefer the mutually exclusive empty option if we're changing this as it might work better with potential future options (if any) where empty is always exclusive.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this can be solved a different way.

The most intuitive approach would be to allow an empty string for ProvisionningUrl and write nothing in the file IMHO

Crossed my mind too, but I agree with Simon about the possible expansion into other options and how that might change behaviour in the future.

Let's go with an explicit empty = true|false and make it an error to enable alongside provisioning URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the PR with an empty parameter and added a few tests for the mutually exclusive condition

Add a simple `empty` bool to allow trigerring the osbuild stage
without any parameters. This is used for CoreOS where we only need that
file to exist in `/boot` without caring about the content.

The boolean is mutually exclusive with the existing `url` parameter.
See https://issues.redhat.com/browse/HMS-10227
@jbtrystram jbtrystram force-pushed the ignition-firstboot-enable branch from 6e44414 to 47942c4 Compare February 24, 2026 15:54
@jbtrystram jbtrystram changed the title Customization: Add a enable boolean to ignition Customization: Add a empty boolean to ignition Feb 24, 2026
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

Nice, I like this 🙂

Copy link
Contributor

@bcl bcl left a comment

Choose a reason for hiding this comment

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

Ack. This also needs documentation added to https://github.com/osbuild/osbuild.github.io/

@supakeen supakeen added this pull request to the merge queue Feb 25, 2026
Merged via the queue into osbuild:main with commit 1057bff Feb 25, 2026
5 checks passed
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
supakeen pushed a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 26, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
jbtrystram added a commit to jbtrystram/osbuild-images that referenced this pull request Feb 27, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Note that we specify the target directory to create the
`ignition.firstboot` stamp, as introduced in [2].
This is required because `bootc install to-filesystem` wants an empty
/boot FS, so we need to run the stage after.

We reuse the bootupd mounts generator. We really only need
/boot, so bootupd is probably a bit overkill but does the job.
We cannot reuse the existing mounts here because the `ostree` generated
mounts are shadowing /boot so the file end up in the wrong place.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
[2] osbuild/osbuild#2149

Signed-off-by: jbtrystram <jbtrystram@redhat.com>
Co-authored-by: Simon de Vlieger <cmdr@supakeen.com>
github-merge-queue bot pushed a commit to osbuild/images that referenced this pull request Feb 27, 2026
This allow setting a `Firstboot.Ignition.Empty` boolean to inject
the igntition firstboot stage[1] after the container is deployed.

Note that we specify the target directory to create the
`ignition.firstboot` stamp, as introduced in [2].
This is required because `bootc install to-filesystem` wants an empty
/boot FS, so we need to run the stage after.

We reuse the bootupd mounts generator. We really only need
/boot, so bootupd is probably a bit overkill but does the job.
We cannot reuse the existing mounts here because the `ostree` generated
mounts are shadowing /boot so the file end up in the wrong place.

Requires osbuild/blueprint#46
[1] https://github.com/osbuild/osbuild/blob/main/stages/org.osbuild.ignition
[2] osbuild/osbuild#2149

Signed-off-by: jbtrystram <jbtrystram@redhat.com>
Co-authored-by: Simon de Vlieger <cmdr@supakeen.com>
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.

5 participants