From 834ee63331c59bc50e5bda90d3546ed20e049135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 8 Aug 2025 10:57:24 +0200 Subject: [PATCH] osbuild: Handle wsl2 images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The images are imported to Koji with type_name set to wsl. We need to know about this so that the image is pulled into the compose, and also translate the type into correct value for productmd. JIRA: RHELCMP-14724 Signed-off-by: Lubomír Sedlář (cherry picked from commit 3ff06bc8ea0345a3c96afe6c1f44a83615ed02d0) --- pungi/phases/osbuild.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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()