From 109d69abfd3194c81fec1bb8a08ca2b6614eafcd Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 19 Oct 2015 17:11:11 -0400 Subject: [PATCH] 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. --- data/model/image.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/model/image.py b/data/model/image.py index bd8fc4302..2aae6abbd 100644 --- a/data/model/image.py +++ b/data/model/image.py @@ -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