Rename accessed items in the data model

This commit is contained in:
Joseph Schorr 2018-11-21 17:38:12 +02:00
parent c233760007
commit ffd567e2c2
3 changed files with 5 additions and 5 deletions

View file

@ -124,7 +124,7 @@ def _create_manifest(repository_id, manifest_interface_instance, storage):
# Determine and populate the legacy image if necessary. Manifest lists will not have a legacy
# image.
legacy_image = None
if manifest_interface_instance.leaf_layer_v1_image_id is not None:
if manifest_interface_instance.has_legacy_image:
legacy_image_id = _populate_legacy_image(repository_id, manifest_interface_instance, blob_map,
retriever)
if legacy_image_id is None:
@ -193,7 +193,7 @@ def _create_manifest(repository_id, manifest_interface_instance, storage):
def _populate_legacy_image(repository_id, manifest_interface_instance, blob_map, retriever):
# Lookup all the images and their parent images (if any) inside the manifest.
# This will let us know which v1 images we need to synthesize and which ones are invalid.
docker_image_ids = list(manifest_interface_instance.legacy_image_ids)
docker_image_ids = list(manifest_interface_instance.get_legacy_image_ids(retriever))
images_query = lookup_repository_images(repository_id, docker_image_ids)
image_storage_map = {i.docker_image_id: i.storage for i in images_query}

View file

@ -403,8 +403,8 @@ def test_get_or_create_manifest_with_remote_layers(initialized_db):
assert remote_digest not in manifest.local_blob_digests
assert manifest.has_remote_layer
assert manifest.leaf_layer_v1_image_id is None
assert manifest.get_v1_compatible_manifest('foo', 'bar', 'baz', None) is None
assert not manifest.has_legacy_image
assert manifest.get_schema1_manifest('foo', 'bar', 'baz', None) is None
# Write the manifest.
created_tuple = get_or_create_manifest(repository, manifest, storage)

View file

@ -478,7 +478,7 @@ class OCIModel(SharedModel, RegistryDataInterface):
return None
retriever = RepositoryContentRetriever(manifest_row.repository_id, storage)
return parsed.get_v1_compatible_manifest(namespace_name, repo_name, tag_name, retriever)
return parsed.get_schema1_manifest(namespace_name, repo_name, tag_name, retriever)
def create_manifest_with_temp_tag(self, repository_ref, manifest_interface_instance,
expiration_sec, storage):