From 3e550b4b71f4c7ae7045364f757214ffd93b876f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 13 Nov 2014 15:13:44 -0500 Subject: [PATCH] Make sure to sort the images for the squashed image system --- endpoints/verbs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/endpoints/verbs.py b/endpoints/verbs.py index 33a214788..c2dfa17a6 100644 --- a/endpoints/verbs.py +++ b/endpoints/verbs.py @@ -27,7 +27,9 @@ def _open_stream(namespace, repository, tag, synthetic_image_id, image_json, ima # For performance reasons, we load the full image list here, cache it, then disconnect from # the database. with database.UseThenDisconnect(app.config): - image_list = model.get_matching_repository_images(namespace, repository, image_id_list) + image_list = list(model.get_matching_repository_images(namespace, repository, image_id_list)) + + image_list.sort(key=lambda image: image_id_list.index(image.docker_image_id)) def get_next_image(): for current_image in image_list: