ostree-installer: Allow overwriting buildinstall
Relates: https://pagure.io/pungi/issue/909 Relates: https://pagure.io/pungi/issue/695 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
543154d597
commit
7c237c2c63
@ -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
|
``template_repo`` needs to point to a Git repository from which to take the
|
||||||
templates.
|
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
|
Example config
|
||||||
--------------
|
--------------
|
||||||
|
@ -968,6 +968,11 @@ def make_schema():
|
|||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
"ostree_installer_overwrite": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": False,
|
||||||
|
},
|
||||||
|
|
||||||
"live_images": _variant_arch_mapping(
|
"live_images": _variant_arch_mapping(
|
||||||
_one_or_list({"$ref": "#/definitions/live_image_config"})
|
_one_or_list({"$ref": "#/definitions/live_image_config"})
|
||||||
),
|
),
|
||||||
|
@ -28,7 +28,7 @@ class OstreeInstallerPhase(PhaseLoggerMixin, ConfigGuardedPhase):
|
|||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
errors = exc.message.split('\n')
|
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 variant in self.compose.get_variants():
|
||||||
for arch in variant.arches:
|
for arch in variant.arches:
|
||||||
conf = util.get_arch_variant_data(self.compose.conf, self.name,
|
conf = util.get_arch_variant_data(self.compose.conf, self.name,
|
||||||
|
@ -74,6 +74,17 @@ class OstreeInstallerPhaseTest(helpers.PungiTestCase):
|
|||||||
phase = ostree.OstreeInstallerPhase(compose, mock.Mock(_skipped=True))
|
phase = ostree.OstreeInstallerPhase(compose, mock.Mock(_skipped=True))
|
||||||
phase.validate()
|
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):
|
class OstreeThreadTest(helpers.PungiTestCase):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user