From 9f1ec9d47dda198110a2db0d0631a6cd535b79ec Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 9 Feb 2015 16:29:15 -0500 Subject: [PATCH] Fix loading of partial caching under a tag --- buildman/jobutil/buildjob.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/buildman/jobutil/buildjob.py b/buildman/jobutil/buildjob.py index 4d85a76c1..bcf2c33c2 100644 --- a/buildman/jobutil/buildjob.py +++ b/buildman/jobutil/buildjob.py @@ -92,16 +92,18 @@ class BuildJob(object): repo_name = repo_build.repository.name current_image = model.get_image(repo_build.repository, base_image_id) + next_image = None if current_image is None: return None # For each cache comment, find a child image that matches the command. for cache_command in cache_commands: full_command = '["/bin/sh", "-c", "%s"]' % cache_command - current_image = model.find_child_image(repo_build.repository, current_image, full_command) - if current_image is None: - return None + next_image = model.find_child_image(repo_build.repository, current_image, full_command) + if next_image is None: + break + current_image = next_image logger.debug('Found cached image %s for comment %s', current_image.id, full_command) # Find a tag associated with the image, if any.