Merge pull request #847 from jakedt/forwardport
Forward port changes: We must fill in the parent_id on linking
This commit is contained in:
commit
ca8e9d89c8
1 changed files with 9 additions and 2 deletions
|
@ -196,14 +196,21 @@ def _find_or_link_image(existing_image, repo_obj, username, translations, prefer
|
||||||
copied_storage.locations = {placement.location.name
|
copied_storage.locations = {placement.location.name
|
||||||
for placement in copied_storage.imagestorageplacement_set}
|
for placement in copied_storage.imagestorageplacement_set}
|
||||||
|
|
||||||
|
translated_parent_id = None
|
||||||
|
if new_image_ancestry != '/':
|
||||||
|
translated_parent_id = int(new_image_ancestry.split('/')[-2])
|
||||||
|
|
||||||
new_image = Image.create(docker_image_id=existing_image.docker_image_id,
|
new_image = Image.create(docker_image_id=existing_image.docker_image_id,
|
||||||
repository=repo_obj, storage=copied_storage,
|
repository=repo_obj,
|
||||||
|
storage=copied_storage,
|
||||||
ancestors=new_image_ancestry,
|
ancestors=new_image_ancestry,
|
||||||
command=existing_image.command,
|
command=existing_image.command,
|
||||||
created=existing_image.created,
|
created=existing_image.created,
|
||||||
comment=existing_image.comment,
|
comment=existing_image.comment,
|
||||||
v1_json_metadata=existing_image.v1_json_metadata,
|
v1_json_metadata=existing_image.v1_json_metadata,
|
||||||
aggregate_size=existing_image.aggregate_size)
|
aggregate_size=existing_image.aggregate_size,
|
||||||
|
parent_id=translated_parent_id,
|
||||||
|
v1_checksum=existing_image.v1_checksum)
|
||||||
|
|
||||||
|
|
||||||
logger.debug('Storing translation %s -> %s', existing_image.id, new_image.id)
|
logger.debug('Storing translation %s -> %s', existing_image.id, new_image.id)
|
||||||
|
|
Reference in a new issue