From 95c47fe250cbb0c27b1a8ec9aa5398f14fe35147 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 3 Nov 2015 14:43:47 -0500 Subject: [PATCH] Fix layer ordering in verbs --- endpoints/verbs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/endpoints/verbs.py b/endpoints/verbs.py index 4e67733c7..4365d95a7 100644 --- a/endpoints/verbs.py +++ b/endpoints/verbs.py @@ -31,6 +31,10 @@ def _open_stream(formatter, namespace, repository, tag, synthetic_image_id, imag image_list = list(model.image.get_parent_images(namespace, repository, repo_image)) image_list.append(repo_image) + # Note: The image list ordering must be from top-level image, downward, so we reverse the order + # here. + image_list.reverse() + def get_next_image(): for current_image in image_list: yield current_image @@ -42,7 +46,8 @@ def _open_stream(formatter, namespace, repository, tag, synthetic_image_id, imag current_image_path) current_image_id = current_image_entry.id - logger.debug('Returning image layer %s: %s', current_image_id, current_image_path) + logger.debug('Returning image layer %s (%s): %s', current_image_id, + current_image_entry.docker_image_id, current_image_path) yield current_image_stream stream = formatter.build_stream(namespace, repository, tag, synthetic_image_id, image_json,