Skip to content

Commit

Permalink
bib: add vhd to supported image types
Browse files Browse the repository at this point in the history
This is the coresponding change to the images PR [0] that adds
support to build `vhd` type images directly via bib.

[0] osbuild/images#909
  • Loading branch information
mvo5 committed Sep 5, 2024
1 parent 1358ac2 commit 67ffd95
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions bib/cmd/bootc-image-builder/build_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var supportedImageTypes = map[string]BuildType{
"qcow2": BuildTypeDisk,
"raw": BuildTypeDisk,
"vmdk": BuildTypeDisk,
"vhd": BuildTypeDisk,
"anaconda-iso": BuildTypeISO,
"iso": BuildTypeISO,
}
Expand Down
4 changes: 3 additions & 1 deletion bib/cmd/bootc-image-builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ func cmdBuild(cmd *cobra.Command, args []string) error {
exports = append(exports, "image")
case "vmdk":
exports = append(exports, "vmdk")

case "vhd":
// should we make "vhd" just an alias for "vpc" everywhere?
exports = append(exports, "vpc")
case "anaconda-iso", "iso":
exports = append(exports, "bootiso")
default:
Expand Down
3 changes: 2 additions & 1 deletion test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def build_images(shared_tmpdir, build_container, request, force_aws_upload):
"ami": pathlib.Path(output_path) / "image/disk.raw",
"raw": pathlib.Path(output_path) / "image/disk.raw",
"vmdk": pathlib.Path(output_path) / "vmdk/disk.vmdk",
"vhd": pathlib.Path(output_path) / "vpc/disk.vhd",
"anaconda-iso": pathlib.Path(output_path) / "bootiso/install.iso",
}
assert len(artifact) == len(set(tc.image for tc in gen_testcases("all"))), \
Expand Down Expand Up @@ -453,7 +454,7 @@ def test_iso_installs(image_type):
@pytest.mark.parametrize("images", gen_testcases("multidisk"), indirect=["images"])
def test_multi_build_request(images):
artifacts = set()
expected = {"disk.qcow2", "disk.raw", "disk.vmdk"}
expected = {"disk.qcow2", "disk.raw", "disk.vhd", "disk.vmdk"}
for result in images:
filename = os.path.basename(result.img_path)
assert result.img_path.exists()
Expand Down
4 changes: 2 additions & 2 deletions test/testcases.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import platform

# disk image types can be build from a single manifest
DISK_IMAGE_TYPES = ("qcow2", "raw", "vmdk")
DISK_IMAGE_TYPES = ("qcow2", "raw", "vmdk", "vhd")

# supported images that can be booted in a cloud
CLOUD_BOOT_IMAGE_TYPES = ("ami",)
Expand Down Expand Up @@ -88,7 +88,7 @@ def gen_testcases(what): # pylint: disable=too-many-return-statements
return [
klass(image=img)
for klass in (TestCaseCentos, TestCaseFedora)
for img in ("ami", "anaconda-iso", "qcow2", "raw", "vmdk")
for img in ("ami", "anaconda-iso", "qcow2", "raw", "vmdk", "vhd")
]
if what == "multidisk":
# single test that specifies all image types
Expand Down

0 comments on commit 67ffd95

Please sign in to comment.