Skip to content

Partition extras are exported incorrectly when using --output-name #2737

Description

@onesaladleaf

We're using --output-name for easier post-processing of the resulting images, however it is incompatible with the new extras feature. For example, building images like this:

image-builder \
            --bootc-ref=localhost/reproducer:latest \
            --output-dir=/output \
            --progress=verbose \
            --output-name=disk.raw \
            --with-extra '*' \
            raw

extras.yaml:

partitions:
  esp:
    mountpoint: "/boot/efi"
  root:
    mountpoint: "/"

Results in the following behaviour:

(...)
Checkpoints
Image build successful: /output/disk.raw
Image build successful: /output/disk.raw.raw
Image build successful: /output/disk.raw.raw

image-builder names both extras disk.raw.raw overwriting this file for every extra

Activity

  1. supakeen commented on Oct 2, 2026

    @supakeen
    Member

    Going to mark this as a bug though I don't really have a good idea on how to solve it. We can't change the semantics of --output-name for the primary artifact because it's pretty load bearing and integrated in many pipelines. There's two issues here:

    1. Duplicate --output-name for extras.
    2. Non-handling of the default extension of extras.

    For the primary artifact we compare the --output-name extension with the 'default' extension of the artifact and drop them if they are the same, we could probably apply the same to extras but that would still be kinda funky because say --output-name disk.raw would produce a disk.raw.erofs in certain cases as well.

    Now we do have an escape hatch; --output-name accepts Go templates so you can conditionally include the name of the extra. For example --output-name 'disk{{- if .Extra.Name -}}-{{- .Extra.Name -}}{{- end }}' (note; don't set the .raw; it'll be added automatically). You'd get disk.raw, disk-esp.raw, disk-root.raw.

    Do you have any ideas how this should work when passing a literal --output-name?

  2. onesaladleaf commented on Oct 9, 2026

    @onesaladleaf
    Author

    Now we do have an escape hatch; --output-name accepts Go templates so you can conditionally include the name of the extra. For example --output-name 'disk{{- if .Extra.Name -}}-{{- .Extra.Name -}}{{- end }}' (note; don't set the .raw; it'll be added automatically). You'd get disk.raw, disk-esp.raw, disk-root.raw.

    Thanks, I'll try that

    Do you have any ideas how this should work when passing a literal --output-name?

    Maybe the extra names could automatically default to e.g. <output-name>-<extra-name>.raw or <extra-name>-<output-name>.raw when --output-name is provided?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions