kiwibuild: Allow setting metadata type explicitly
It is not possible to reliably detect what the type for an image should be in the metadata. This commit adds an option for user to explicitly provide it. It can only be configured on the specific image, not globally. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
d9d21d3cf4
commit
cd2ae81e3c
4 changed files with 12 additions and 5 deletions
|
|
@ -1574,6 +1574,9 @@ KiwiBuild Settings
|
|||
described in :ref:`automatic versioning <auto-version>`.
|
||||
* ``repo_releasever`` -- (*str*) Override default releasever of the output
|
||||
image.
|
||||
* ``manifest_type`` -- the image type that is put into the manifest by
|
||||
pungi. If not supplied, an autodetected value will be provided. It may or
|
||||
may not make sense.
|
||||
|
||||
The options can be set either for the specific image, or at the phase level
|
||||
(see below). Version also falls back to ``global_version``.
|
||||
|
|
|
|||
|
|
@ -1214,6 +1214,7 @@ def make_schema():
|
|||
"bundle_name_format": {"type": "string"},
|
||||
"version": {"type": "string"},
|
||||
"repo_releasever": {"type": "string"},
|
||||
"manifest_type": {"type": "string"},
|
||||
},
|
||||
"required": [
|
||||
# description_scm and description_path
|
||||
|
|
|
|||
|
|
@ -211,9 +211,9 @@ class RunKiwiBuildThread(WorkerThread):
|
|||
# Update image manifest
|
||||
img = Image(compose.im)
|
||||
|
||||
# Get the manifest type from the config if supplied, otherwise we
|
||||
# determine the manifest type based on the koji output
|
||||
img.type = type_
|
||||
# If user configured exact type, use it, otherwise try to
|
||||
# figure it out based on the koji output.
|
||||
img.type = config.get("manifest_type", type_)
|
||||
img.format = format_
|
||||
img.path = os.path.join(rel_image_dir, filename)
|
||||
img.mtime = util.get_mtime(image_dest)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class TestKiwiBuildPhase(PungiTestCase):
|
|||
"bundle_name_format": "fmt",
|
||||
"version": "Rawhide",
|
||||
"repo_releasever": "41",
|
||||
"manifest_type": "live-kiwi",
|
||||
},
|
||||
MINIMAL_CONF,
|
||||
)
|
||||
|
|
@ -366,7 +367,9 @@ class TestKiwiBuildThread(PungiTestCase):
|
|||
"kiwibuild_bundle_format": "%N-%P-40_Beta-%I.%A.%T",
|
||||
},
|
||||
)
|
||||
config = _merge({"subvariant": "Test"}, MINIMAL_CONF)
|
||||
config = _merge(
|
||||
{"subvariant": "Test", "manifest_type": "live-kiwi"}, MINIMAL_CONF
|
||||
)
|
||||
pool = mock.Mock()
|
||||
|
||||
get_image_paths = KojiWrapper.return_value.get_image_paths
|
||||
|
|
@ -459,7 +462,7 @@ class TestKiwiBuildThread(PungiTestCase):
|
|||
assert kwargs["arch"] == image.arch
|
||||
assert image.path == expected_path
|
||||
assert "iso" == image.format
|
||||
assert "iso" == image.type
|
||||
assert "live-kiwi" == image.type
|
||||
assert image.bootable
|
||||
assert "Test" == image.subvariant
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue