From fe77f2165c9d550ca7990e14556155005e5ea994 Mon Sep 17 00:00:00 2001 From: Luiz Carvalho Date: Mar 09 2020 13:21:25 +0000 Subject: Fix base image parent assignment If an image does not have a parent, ensure that `LightBlue.find_parent_images_with_package` does not return the image itself as a parent. Signed-off-by: Luiz Carvalho --- diff --git a/freshmaker/lightblue.py b/freshmaker/lightblue.py index cde3d27..b1aef6e 100644 --- a/freshmaker/lightblue.py +++ b/freshmaker/lightblue.py @@ -1296,15 +1296,18 @@ class LightBlue(object): images = [] parent_image = None - children = images if images else [child_image] # We first try to find the parent from the `parent_brew_build` field in Lightblue. parent_brew_build = self.find_parent_brew_build_nvr_from_child(child_image) # We've reached the base image, stop recursion if not parent_brew_build: - return children + return images parent_image = self.get_images_by_nvrs([parent_brew_build], srpm_names=[srpm_name], published=None) if parent_image: + # In some cases, an image may not have its content sets defined. To + # circumvent this gap, we use the list of child images when calling + # resolve so their content sets can be used. + children = images if images else [child_image] parent_image = parent_image[0] parent_image.resolve(self, children)