Fix v1 backward compatibility
This commit is contained in:
parent
cf1ec68046
commit
44d06b0c2e
2 changed files with 4 additions and 2 deletions
|
@ -410,8 +410,10 @@ def synthesize_v1_image(repo, image_storage, docker_image_id, created_date_str,
|
|||
specified metadata.
|
||||
"""
|
||||
ancestors = '/'
|
||||
parent_id = None
|
||||
if parent_image is not None:
|
||||
ancestors = '{0}{1}/'.format(parent_image.ancestors, parent_image.id)
|
||||
parent_id = parent_image.id
|
||||
|
||||
created = None
|
||||
if created_date_str is not None:
|
||||
|
@ -423,7 +425,7 @@ def synthesize_v1_image(repo, image_storage, docker_image_id, created_date_str,
|
|||
|
||||
return Image.create(docker_image_id=docker_image_id, ancestors=ancestors, comment=comment,
|
||||
command=command, v1_json_metadata=v1_json_metadata, created=created,
|
||||
storage=image_storage, repository=repo)
|
||||
storage=image_storage, repository=repo, parent_id=parent_id)
|
||||
|
||||
|
||||
def ensure_image_locations(*names):
|
||||
|
|
|
@ -340,7 +340,7 @@ def _write_manifest(namespace, repo_name, manifest):
|
|||
raise ManifestInvalid(detail={'message': 'manifest does not reference any layers'})
|
||||
|
||||
# Store the manifest pointing to the tag.
|
||||
leaf_layer = layers[0]
|
||||
leaf_layer = layers[-1]
|
||||
model.tag.store_tag_manifest(namespace, repo_name, tag_name, leaf_layer.v1_metadata.docker_id,
|
||||
manifest_digest, request.data)
|
||||
|
||||
|
|
Reference in a new issue