Use new container and bootable-container productmd types
In https://github.com/release-engineering/productmd/pull/181 I added new `bootable-container` and `container` types to productmd. This makes pungi always use the bootable-container type for ostree_container images (previously 'ociarchive'), and default to using the container type for Kiwi-built oci.tar.xz container images (previously 'docker'). This is a significant change for anything that relies on productmd/fedfind conventions to 'identify' images, as these images will now have a different identity. But I think it's a valuable improvement in their identities. 'ociarchive' never made any sense as an image 'type' - it's a format - and 'docker' wasn't a very good type for images that are explicitly OCI container images, not Docker-native ones. We also can now easily distinguish between 'regular' container images and ones that are intended to be bootable. Signed-off-by: Adam Williamson <awilliam@redhat.com> (cherry picked from commit 3cb8992d56f2cee8a7cb151253125e30931ccd6d)
This commit is contained in:
parent
fddce94704
commit
ac7e1e515e
@ -25,6 +25,7 @@ KIWIEXTENSIONS = [
|
||||
("fex", ["squashfs.xz"], "squashfs.xz"),
|
||||
("fex", ["squashfs.gz"], "squashfs.gz"),
|
||||
("fex", ["squashfs"], "squashfs"),
|
||||
("container", ["oci.tar.xz"], "tar.xz"),
|
||||
]
|
||||
|
||||
|
||||
@ -242,13 +243,15 @@ class RunKiwiBuildThread(WorkerThread):
|
||||
|
||||
|
||||
def _find_type_and_format(path):
|
||||
# these are our kiwi-exclusive mappings for images whose extensions
|
||||
# aren't quite the same as imagefactory. they come first as we
|
||||
# want our oci.tar.xz mapping to win over the tar.xz one in
|
||||
# EXTENSIONS
|
||||
for type_, suffixes, format_ in KIWIEXTENSIONS:
|
||||
if any(path.endswith(suffix) for suffix in suffixes):
|
||||
return type_, format_
|
||||
for type_, suffixes in EXTENSIONS.items():
|
||||
for suffix in suffixes:
|
||||
if path.endswith(suffix):
|
||||
return type_, suffix
|
||||
# these are our kiwi-exclusive mappings for images whose extensions
|
||||
# aren't quite the same as imagefactory
|
||||
for type_, suffixes, format_ in KIWIEXTENSIONS:
|
||||
if any(path.endswith(suffix) for suffix in suffixes):
|
||||
return type_, format_
|
||||
return None, None
|
||||
|
@ -164,9 +164,9 @@ class OSTreeContainerThread(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 = "ociarchive"
|
||||
# these are hardcoded as they should always be correct, we
|
||||
# could potentially allow overriding them via config though
|
||||
img.type = "bootable-container"
|
||||
img.format = "ociarchive"
|
||||
img.path = os.path.relpath(fullpath, compose.paths.compose.topdir())
|
||||
img.mtime = util.get_mtime(fullpath)
|
||||
|
Loading…
Reference in New Issue
Block a user