Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions data/distrodefs/bootc-generic/imagetypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
x86_64:
type: "gpt"
partitions:
-
size: "1 MiB"
- size: "1 MiB"
bootable: true
type: *bios_boot_partition_guid
- &default_partition_table_part_efi
Expand Down Expand Up @@ -124,6 +123,12 @@ image_types:
blueprint:
supported_options: *supported_options_disk

"raw-xz":
<<: *raw_image_type
filename: "disk.raw.xz"
compression: "xz"
mime_type: "application/xz"

"ami":
<<: *raw_image_type
filename: "disk.raw"
Expand Down
1 change: 1 addition & 0 deletions internal/bibimg/imagetypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var supportedImageTypes = map[string]imageType{
"ami": imageType{Export: "image"},
"qcow2": imageType{Export: "qcow2"},
"raw": imageType{Export: "image"},
"raw-xz": imageType{Export: "image"},
"vmdk": imageType{Export: "vmdk"},
"vhd": imageType{Export: "vpc"},
"gce": imageType{Export: "gce"},
Expand Down
11 changes: 8 additions & 3 deletions internal/bibimg/imagetypes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func TestImageTypes(t *testing.T) {
expectedExports: []string{"xz"},
expectISO: false,
},
"raw-xz": {
imageTypes: []string{"raw-xz"},
expectedExports: []string{"image"},
expectISO: false,
},
"bad-mix": {
imageTypes: []string{"vmdk", "anaconda-iso"},
expectedErr: errors.New("cannot mix ISO/disk images in request [vmdk anaconda-iso]"),
Expand All @@ -72,15 +77,15 @@ func TestImageTypes(t *testing.T) {
},
"bad-image-type": {
imageTypes: []string{"bad"},
expectedErr: errors.New(`unsupported image type "bad", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, pxe-tar-xz, qcow2, raw, vhd, vmdk`),
expectedErr: errors.New(`unsupported image type "bad", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, pxe-tar-xz, qcow2, raw, raw-xz, vhd, vmdk`),
},
"bad-in-good": {
imageTypes: []string{"ami", "raw", "vmdk", "qcow2", "something-else-what-is-this"},
expectedErr: errors.New(`unsupported image type "something-else-what-is-this", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, pxe-tar-xz, qcow2, raw, vhd, vmdk`),
expectedErr: errors.New(`unsupported image type "something-else-what-is-this", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, pxe-tar-xz, qcow2, raw, raw-xz, vhd, vmdk`),
},
"all-bad": {
imageTypes: []string{"bad1", "bad2", "bad3", "bad4", "bad5", "bad42"},
expectedErr: errors.New(`unsupported image type "bad1", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, pxe-tar-xz, qcow2, raw, vhd, vmdk`),
expectedErr: errors.New(`unsupported image type "bad1", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, pxe-tar-xz, qcow2, raw, raw-xz, vhd, vmdk`),
},
}

Expand Down
Loading