Correct subvariant handling for ostree_container phase
The image metadata construction code allows for subvariant to be set in the image config dict, but checks.py doesn't expect it; fix that. Also, when a subvariant is set, use it in the image name template rather than the variant; otherwise you can't build more than one subvariant in any variant (they will have identical names, which isn't alllowed). Signed-off-by: Adam Williamson <awilliam@redhat.com> (cherry picked from commit 391a5eaed5198e5ee2941dac4ae43a2fe057eedd)
This commit is contained in:
parent
059995a200
commit
a0a155ebcd
@ -1886,6 +1886,10 @@ will thus create a new OCI archive image *from scratch*.
|
||||
reference will not be created.
|
||||
* ``runroot_packages`` -- (*list*) A list of additional package names to be
|
||||
installed in the runroot environment in Koji.
|
||||
* ``subvariant`` -- (*str*) The subvariant value to be used in the metadata
|
||||
for the image. Also used in the image's filename. Defaults to being the
|
||||
same as the variant. If building more than one ostree container in a
|
||||
variant, each must have a unique subvariant.
|
||||
|
||||
Example config
|
||||
--------------
|
||||
|
@ -1114,6 +1114,7 @@ def make_schema():
|
||||
"runroot_packages": {
|
||||
"$ref": "#/definitions/list_of_strings",
|
||||
},
|
||||
"subvariant": {"type": "string"},
|
||||
},
|
||||
"required": [
|
||||
"treefile",
|
||||
|
@ -119,12 +119,13 @@ class OSTreeContainerThread(WorkerThread):
|
||||
def _run_ostree_container_cmd(
|
||||
self, compose, variant, arch, config, config_repo, extra_config_file=None
|
||||
):
|
||||
subvariant = config.get("subvariant", variant.uid)
|
||||
target_dir = compose.paths.compose.image_dir(variant) % {"arch": arch}
|
||||
util.makedirs(target_dir)
|
||||
version = util.version_generator(compose, config.get("version"))
|
||||
archive_name = "%s-%s-%s" % (
|
||||
compose.conf["release_short"],
|
||||
variant.uid,
|
||||
subvariant,
|
||||
version,
|
||||
)
|
||||
|
||||
@ -177,7 +178,7 @@ class OSTreeContainerThread(WorkerThread):
|
||||
img.disc_number = 1
|
||||
img.disc_count = 1
|
||||
img.bootable = False
|
||||
img.subvariant = config.get("subvariant", variant.uid)
|
||||
img.subvariant = subvariant
|
||||
setattr(img, "can_fail", self.can_fail)
|
||||
setattr(img, "deliverable", "ostree-container")
|
||||
compose.im.add(variant=variant.uid, arch=arch, image=img)
|
||||
|
Loading…
Reference in New Issue
Block a user