From 059995a200e54b84715eadd4fa09d5b364da136c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 19 Sep 2024 14:00:45 -0700 Subject: [PATCH] image_build: drop .tar.gz as an expected extension for docker Koji's image-build command has not been capable of producing a docker image with .tar.gz as its extension since 2015: https://pagure.io/koji/c/b489f282bee7a008108534404dd2e78efb2256e7?branch=master as that commit message implies, the files have not actually been gzip-compressed for even longer: https://pagure.io/koji/c/82a405c7943192e3bba3340efe7a8d07a0e26b70?branch=master so there's no point to having this any more. It is causing the wrong productmd 'type' to be set for GCE cloud images, which *do* have the .tar.gz extension - because docker appears in this dict before tar-gz, their type is being set as 'docker' not 'tar-gz'. Signed-off-by: Adam Williamson (cherry picked from commit 739062ed3c471e74ba9c5144c4047f67f9fbe8c8) --- pungi/phases/image_build.py | 2 +- tests/test_imagebuildphase.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pungi/phases/image_build.py b/pungi/phases/image_build.py index cd034cd2..c28ccc2f 100644 --- a/pungi/phases/image_build.py +++ b/pungi/phases/image_build.py @@ -28,7 +28,7 @@ from productmd.rpms import Rpms # values. This dict is imported and extended for similar purposes by other # phases (at least osbuild and kiwibuild). EXTENSIONS = { - "docker": ["tar.gz", "tar.xz"], + "docker": ["tar.xz"], "liveimg-squashfs": ["liveimg.squashfs"], "qcow": ["qcow"], "qcow2": ["qcow2"], diff --git a/tests/test_imagebuildphase.py b/tests/test_imagebuildphase.py index 2cf982da..b3397f9a 100644 --- a/tests/test_imagebuildphase.py +++ b/tests/test_imagebuildphase.py @@ -843,12 +843,12 @@ class TestCreateImageBuildThread(PungiTestCase): "amd64": [ "/koji/task/1235/tdl-amd64.xml", "/koji/task/1235/Fedora-Docker-Base-20160103.amd64.qcow2", - "/koji/task/1235/Fedora-Docker-Base-20160103.amd64.tar.gz", + "/koji/task/1235/Fedora-Docker-Base-20160103.amd64.tar.xz", ], "x86_64": [ "/koji/task/1235/tdl-x86_64.xml", "/koji/task/1235/Fedora-Docker-Base-20160103.x86_64.qcow2", - "/koji/task/1235/Fedora-Docker-Base-20160103.x86_64.tar.gz", + "/koji/task/1235/Fedora-Docker-Base-20160103.x86_64.tar.xz", ], } @@ -893,9 +893,9 @@ class TestCreateImageBuildThread(PungiTestCase): link_type="hardlink-or-copy", ), mock.call.link( - "/koji/task/1235/Fedora-Docker-Base-20160103.amd64.tar.gz", + "/koji/task/1235/Fedora-Docker-Base-20160103.amd64.tar.xz", self.topdir - + "/compose/Client/amd64/images/Fedora-Docker-Base-20160103.amd64.tar.gz", # noqa: E501 + + "/compose/Client/amd64/images/Fedora-Docker-Base-20160103.amd64.tar.xz", # noqa: E501 link_type="hardlink-or-copy", ), mock.call.link( @@ -905,9 +905,9 @@ class TestCreateImageBuildThread(PungiTestCase): link_type="hardlink-or-copy", ), mock.call.link( - "/koji/task/1235/Fedora-Docker-Base-20160103.x86_64.tar.gz", + "/koji/task/1235/Fedora-Docker-Base-20160103.x86_64.tar.xz", self.topdir - + "/compose/Client/x86_64/images/Fedora-Docker-Base-20160103.x86_64.tar.gz", # noqa: E501 + + "/compose/Client/x86_64/images/Fedora-Docker-Base-20160103.x86_64.tar.xz", # noqa: E501 link_type="hardlink-or-copy", ), ], @@ -919,8 +919,8 @@ class TestCreateImageBuildThread(PungiTestCase): "type": "qcow2", "arch": "amd64", }, - "image_dir/Client/amd64/Fedora-Docker-Base-20160103.amd64.tar.gz": { - "format": "tar.gz", + "image_dir/Client/amd64/Fedora-Docker-Base-20160103.amd64.tar.xz": { + "format": "tar.xz", "type": "docker", "arch": "amd64", }, @@ -929,8 +929,8 @@ class TestCreateImageBuildThread(PungiTestCase): "type": "qcow2", "arch": "x86_64", }, - "image_dir/Client/x86_64/Fedora-Docker-Base-20160103.x86_64.tar.gz": { - "format": "tar.gz", + "image_dir/Client/x86_64/Fedora-Docker-Base-20160103.x86_64.tar.xz": { + "format": "tar.xz", "type": "docker", "arch": "x86_64", },