#321 Do not limit the LB query for `leaf_container_images` to published images only.
Merged 5 years ago by jkaluza. Opened 5 years ago by jkaluza.
jkaluza/freshmaker odcs-builds-source  into  master

file modified
+5 -2
@@ -1124,8 +1124,10 @@ 

              images = self.find_images_with_included_srpms(

                  content_sets, srpm_names, repos, published)

          else:

+             # The `leaf_container_images` can contain unpublished container image,

+             # therefore set `published` to None.

              images = self.get_images_by_nvrs(

-                 leaf_container_images, published, content_sets, srpm_names)

+                 leaf_container_images, None, content_sets, srpm_names)

  

          # There can be multi-arch images which share the same

          # image['brew']['build']. Freshmaker is not interested in the image
@@ -1391,7 +1393,8 @@ 

              Freshmaker configuration.

          :param list leaf_container_images: List of NVRs of leaf images to

              consider for the rebuild. If not set, all images found in

-             Lightblue will be considered for rebuild.

+             Lightblue will be considered for rebuild. Note that `published`

+             is not respected when `leaf_container_images` are used.

          """

          images = self.find_images_with_packages_from_content_set(

              srpm_names, content_sets, filter_fnc, published, deprecated,

file modified
+1 -2
@@ -1405,8 +1405,7 @@ 

                          {'field': 'brew.build', 'rvalue': 'bar', 'op': '='}]},

                      {'field': 'parsed_data.files.*.key', 'rvalue': 'buildfile', 'op': '='},

                      {'$or': [{'field': 'content_sets.*', 'rvalue': 'dummy-content-set', 'op': '='}]},

-                     {'$or': [{'field': 'rpm_manifest.*.rpms.*.srpm_name', 'rvalue': 'openssl', 'op': '='}]},

-                     {'field': 'repositories.*.published', 'rvalue': True, 'op': '='}]},

+                     {'$or': [{'field': 'rpm_manifest.*.rpms.*.srpm_name', 'rvalue': 'openssl', 'op': '='}]}]},

               'projection': [{'field': 'brew', 'include': True, 'recursive': True},

                              {'field': 'parsed_data.files', 'include': True, 'recursive': True},

                              {'field': 'parsed_data.layers.*', 'include': True, 'recursive': True},

Using the leaf_container_images, the user of LB class defines the list of NVRs
of container images which should be found in LB and rebuilt later. Therefore it
does not make sense to limit such list and return only published images, because
the NVR was strictly requested for a rebuild.

Pull-Request has been merged by jkaluza

5 years ago