Copy new fields over to the linked image

This potentially fixes an issue with the v2 image field backfill. We
should be safe to copy these fields over at link time so that hopefully
it doesn't get skipped by the docker client. `_find_or_link_image`
should NEVER be used by the registry v2 protocol.
This commit is contained in:
Jimmy Zelinskie 2015-10-19 17:11:11 -04:00
parent 601b741c4e
commit 109d69abfd

View file

@ -191,7 +191,12 @@ def _find_or_link_image(existing_image, repo_obj, username, translations, prefer
new_image = Image.create(docker_image_id=existing_image.docker_image_id,
repository=repo_obj, storage=copied_storage,
ancestors=new_image_ancestry)
ancestors=new_image_ancestry,
command=existing_image.command,
created=existing_image.created,
comment=existing_image.comment,
aggregate_size=existing_image.aggregate_size)
logger.debug('Storing translation %s -> %s', existing_image.id, new_image.id)
translations[existing_image.id] = new_image.id