diff --git a/doc/configuration.rst b/doc/configuration.rst index 88ccab21..d28ffdca 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -1341,6 +1341,15 @@ an OSTree repository. This always runs in Koji as a ``runroot`` task. ``template_repo`` needs to point to a Git repository from which to take the templates. +**ostree_installer_overwrite** = False + (*bool*) -- by default if a variant including OSTree installer also creates + regular installer images in buildinstall phase, there will be conflicts (as + the files are put in the same place) and Pungi will report an error and + fail the compose. + + With this option it is possible to opt-in for the overwriting. The + traditional ``boot.iso`` will be in the ``iso/`` subdirectory. + Example config -------------- diff --git a/pungi/checks.py b/pungi/checks.py index d84f24ad..a7905e03 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -968,6 +968,11 @@ def make_schema(): "additionalProperties": False, }), + "ostree_installer_overwrite": { + "type": "boolean", + "default": False, + }, + "live_images": _variant_arch_mapping( _one_or_list({"$ref": "#/definitions/live_image_config"}) ), diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py index adf5bc9f..79f337ef 100644 --- a/pungi/phases/ostree_installer.py +++ b/pungi/phases/ostree_installer.py @@ -28,7 +28,7 @@ class OstreeInstallerPhase(PhaseLoggerMixin, ConfigGuardedPhase): except ValueError as exc: errors = exc.message.split('\n') - if not self.bi._skipped: + if not self.compose.conf['ostree_installer_overwrite'] and not self.bi._skipped: for variant in self.compose.get_variants(): for arch in variant.arches: conf = util.get_arch_variant_data(self.compose.conf, self.name, diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py index cc0fbdf8..23c685ce 100644 --- a/tests/test_ostree_installer_phase.py +++ b/tests/test_ostree_installer_phase.py @@ -74,6 +74,17 @@ class OstreeInstallerPhaseTest(helpers.PungiTestCase): phase = ostree.OstreeInstallerPhase(compose, mock.Mock(_skipped=True)) phase.validate() + def test_validate_overwrite_enabled(self): + compose = helpers.DummyCompose(self.topdir, { + 'ostree_installer_overwrite': True, + 'ostree_installer': [ + ('^Server$', {'x86_64': mock.Mock()}) + ], + }) + + phase = ostree.OstreeInstallerPhase(compose, mock.Mock(_skipped=False)) + phase.validate() + class OstreeThreadTest(helpers.PungiTestCase):