Skip to content

Commit 86bee68

Browse files
committed
bib: add support for --type bootc-installer
This commit adds support for the new `bootc-installer` image type that will take a bootc container and create an ISO out of it. It also adds a new `--installer-payload-ref` option so that the user can specify a different payload container to install. See osbuild/images#1906 for details. This is the equivalent of osbuild#341 for bootc-image-builder and allows us to build these kinds of images with bib now too.
1 parent 48ddcb2 commit 86bee68

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

bib/internal/imagetypes/imagetypes.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ var supportedImageTypes = map[string]imageType{
1717
// XXX: ideally we would look how to consolidate all
1818
// knownledge about disk based image types into the images
1919
// library
20-
"ami": imageType{Export: "image"},
21-
"qcow2": imageType{Export: "qcow2"},
22-
"raw": imageType{Export: "image"},
23-
"vmdk": imageType{Export: "vmdk"},
24-
"vhd": imageType{Export: "vpc"},
25-
"gce": imageType{Export: "gce"},
26-
"ova": imageType{Export: "archive"},
20+
"ami": imageType{Export: "image"},
21+
"qcow2": imageType{Export: "qcow2"},
22+
"raw": imageType{Export: "image"},
23+
"vmdk": imageType{Export: "vmdk"},
24+
"vhd": imageType{Export: "vpc"},
25+
"gce": imageType{Export: "gce"},
26+
"ova": imageType{Export: "archive"},
27+
"bootc-installer": imageType{Export: "bootiso", ISO: true},
2728
// the iso image types are RPM based and legacy/deprecated
2829
"anaconda-iso": imageType{Export: "bootiso", ISO: true, Legacy: true},
2930
"iso": imageType{Export: "bootiso", ISO: true, Legacy: true},

bib/internal/imagetypes/imagetypes_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,25 @@ func TestImageTypes(t *testing.T) {
5757
imageTypes: []string{"vmdk", "anaconda-iso"},
5858
expectedErr: errors.New("cannot mix ISO/disk images in request [vmdk anaconda-iso]"),
5959
},
60-
"bad-mix-part-2": {
60+
"bad-mix-2": {
61+
imageTypes: []string{"vmdk", "bootc-installer"},
62+
expectedErr: errors.New("cannot mix ISO/disk images in request [vmdk bootc-installer]"),
63+
},
64+
"bad-mix-3": {
6165
imageTypes: []string{"ami", "iso"},
6266
expectedErr: errors.New("cannot mix ISO/disk images in request [ami iso]"),
6367
},
6468
"bad-image-type": {
6569
imageTypes: []string{"bad"},
66-
expectedErr: errors.New(`unsupported image type "bad", valid types are ami, anaconda-iso, gce, iso, ova, qcow2, raw, vhd, vmdk`),
70+
expectedErr: errors.New(`unsupported image type "bad", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, qcow2, raw, vhd, vmdk`),
6771
},
6872
"bad-in-good": {
6973
imageTypes: []string{"ami", "raw", "vmdk", "qcow2", "something-else-what-is-this"},
70-
expectedErr: errors.New(`unsupported image type "something-else-what-is-this", valid types are ami, anaconda-iso, gce, iso, ova, qcow2, raw, vhd, vmdk`),
74+
expectedErr: errors.New(`unsupported image type "something-else-what-is-this", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, qcow2, raw, vhd, vmdk`),
7175
},
7276
"all-bad": {
7377
imageTypes: []string{"bad1", "bad2", "bad3", "bad4", "bad5", "bad42"},
74-
expectedErr: errors.New(`unsupported image type "bad1", valid types are ami, anaconda-iso, gce, iso, ova, qcow2, raw, vhd, vmdk`),
78+
expectedErr: errors.New(`unsupported image type "bad1", valid types are ami, anaconda-iso, bootc-installer, gce, iso, ova, qcow2, raw, vhd, vmdk`),
7579
},
7680
}
7781

0 commit comments

Comments
 (0)