Skip to content

cmd/image-builder: support templating output directory and artifact names (HMS-11286) - #2677

Merged
supakeen merged 1 commit into
osbuild:mainfrom
supakeen:output-name-templating
Sep 15, 2026
Merged

supakeen merged 1 commit into
osbuild:mainfrom
supakeen:output-name-templating

Conversation

@supakeen

Copy link
Copy Markdown
Member

Allow using Go templates (and use them internally) on the output-name and output-dir fields. This will make life easier in the future when we have multiple artifacts and generally make things a bit easier for users who want nested outputs or such.

@achilleas-k achilleas-k left a comment

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.

Nice work. Looks good overall, but I'm not sure about the "stem".

Also, error message language needs a fix.

Comment thread cmd/image-builder/main.go Resolved
Comment thread cmd/image-builder/main.go Resolved
@supakeen
supakeen force-pushed the output-name-templating branch from eb2d075 to e90a9fb Compare September 11, 2026 10:24
@achilleas-k achilleas-k changed the title cmd/image-builder: support Go templates (HMS-11286) cmd/image-builder: support templating output directory and artifact names (HMS-11286) Sep 14, 2026
@supakeen

supakeen commented Sep 15, 2026 •

Copy link
Copy Markdown
Member Author

So, perhaps we want to align things here with the templating structure that we usually use in the YAML definitions which means { Arch, Distro.ID }; we'd probably need to copy Distro.ID as we don't want to expose its methods. We could then perhaps have { Arch, Distro.ID, Image } with the image type properties available on Image.

Thoughts? (cc @achilleas-k). Like maybe we don't want to do that since we only want what's relevant for output filenames in here?

@achilleas-k

Copy link
Copy Markdown
Member

maybe we don't want to do that since we only want what's relevant for output filenames in here?

I think so. In my mind, distro, arch, image-type, blueprint name, and export pipeline name are enough, but I'm sure people will want to get more creative at some point. Maybe we can stick to those first and then expand as needed if we ever get requests for more.

Allow using Go templates (and use them internally) on the `output-name`
and `output-dir` fields. This will make life easier in the future when
we have multiple artifacts and generally make things a bit easier for
users who want nested outputs or such.

Signed-off-by: Simon de Vlieger <[email protected]>
@supakeen
supakeen force-pushed the output-name-templating branch from e90a9fb to f3e3c88 Compare September 15, 2026 10:38

@achilleas-k achilleas-k left a comment

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.

Ship it!

@supakeen
supakeen enabled auto-merge September 15, 2026 10:54
@supakeen
supakeen added this pull request to the merge queue Sep 15, 2026
Merged via the queue into osbuild:main with commit 87f7708 Sep 15, 2026
63 of 64 checks passed
@supakeen
supakeen deleted the output-name-templating branch September 15, 2026 14:47
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