Unify the get_layers calls across all implements of manifest schemas to ensure we have a common type returned

Also renames some methods to make it more clear what kind of information they return
This commit is contained in:
Joseph Schorr 2018-11-26 17:58:48 +02:00
parent 180d8847db
commit 4e1ff90cb2
17 changed files with 210 additions and 124 deletions

View file

@ -96,12 +96,6 @@ def _create_manifest(repository_id, manifest_interface_instance, storage):
logger.exception('Could not load manifest labels for child manifest')
return None
# NOTE: Content type restrictions in manifest lists ensure that the child manifests
# must be image manifests, as opposed to lists themselves. We put this check here to
# be extra careful in ensuring we don't create empty manifests. If this reality changes,
# should remove this check.
assert list(child_manifest.layers)
# Get/create the child manifest in the database.
child_manifest_info = get_or_create_manifest(repository_id, child_manifest, storage)
if child_manifest_info is None: