From afb3576a3dc8513173ce079e0f694dae71eccba0 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Wed, 19 Oct 2022 22:28:57 -0400 Subject: [PATCH] Add OCP building back --- iso/empanadas/empanadas/common.py | 3 ++- iso/empanadas/empanadas/scripts/build_image.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iso/empanadas/empanadas/common.py b/iso/empanadas/empanadas/common.py index 404f750..56c0942 100644 --- a/iso/empanadas/empanadas/common.py +++ b/iso/empanadas/empanadas/common.py @@ -107,7 +107,8 @@ ALLOWED_TYPE_VARIANTS = { "Container": ["Base", "Minimal", "UBI"], "EC2": None, "GenericCloud": None, - "Vagrant": ["Libvirt", "Vbox"] + "Vagrant": ["Libvirt", "Vbox"], + "OCP": None } def valid_type_variant(_type: str, variant: str="") -> bool: if _type not in ALLOWED_TYPE_VARIANTS: diff --git a/iso/empanadas/empanadas/scripts/build_image.py b/iso/empanadas/empanadas/scripts/build_image.py index c1d3345..4f4c2a0 100644 --- a/iso/empanadas/empanadas/scripts/build_image.py +++ b/iso/empanadas/empanadas/scripts/build_image.py @@ -107,7 +107,7 @@ class ImageBuild: ["tar", "-C", f"{self.outdir}", "--strip-components=1", "-x", "-f", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", "*/layer.tar"], ["xz", f"{self.outdir}/layer.tar"] ] - if self.image_type in ["GenericCloud"]: + if self.image_type in ["GenericCloud", "OCP"]: self.stage_commands = [ ["qemu-img", "convert", "-c", "-f", "raw", "-O", "qcow2", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", f"{self.outdir}/{self.outname}.qcow2"] ] @@ -283,7 +283,7 @@ class ImageBuild: def package(self) -> int: # Some build types don't need to be packaged by imagefactory # @TODO remove business logic if possible - if self.image_type in ["GenericCloud", "EC2", "Azure", "Vagrant"]: + if self.image_type in ["GenericCloud", "EC2", "Azure", "Vagrant", "OCP"]: self.target_uuid = self.base_uuid if hasattr(self, 'base_uuid') else "" if self.target_uuid: