diff --git a/pungi/phases/osbuild.py b/pungi/phases/osbuild.py index 55f6dbdf..185bf078 100644 --- a/pungi/phases/osbuild.py +++ b/pungi/phases/osbuild.py @@ -16,9 +16,14 @@ from ..threading import TelemetryWorkerThread as WorkerThread # do not exist as `koji image-build` formats OSBUILDEXTENSIONS = EXTENSIONS.copy() OSBUILDEXTENSIONS.update( + # The key is the type_name as used in Koji archive, the second is a list of + # expected file extensions. { "iso": ["iso"], "vhd-compressed": ["vhd.gz", "vhd.xz"], + # The image is technically wsl2, but the type_name in Koji is set to + # wsl. + "wsl": ["wsl"], } ) @@ -269,7 +274,13 @@ class RunOSBuildThread(WorkerThread): # determine the manifest type based on the koji output img.type = config.get("manifest_type") if not img.type: - if archive["type_name"] != "iso": + if archive["type_name"] == "wsl": + # productmd only knows wsl2 as type, so let's translate + # from the koji type so that users don't need to set the + # type explicitly. There really is no other possible type + # here anyway. + img.type = "wsl2" + elif archive["type_name"] != "iso": img.type = archive["type_name"] else: fn = archive["filename"].lower()