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 f7637f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 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
3 changes: 2 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,8 @@ func cmdBuild(cmd *cobra.Command, args []string) error {
exports = append(exports, "image")
case "vmdk":
exports = append(exports, "vmdk")

case "vhd":
exports = append(exports, "vhd")
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) / "vmdk/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

0 comments on commit f7637f0

Please sign in to comment.