@@ -126,8 +126,11 @@ async def init_build_plan(self):
126126 load_okd_only = True ,
127127 )
128128
129- # Filter to only include payload images
130- self .group_images = await self ._filter_payload_images (all_group_images )
129+ # For OKD, do NOT filter to payload-only images
130+ # We need to include base/parent images (like openshift-enterprise-base-rhel9)
131+ # even though they don't have for_payload=true, because they're needed to build payload images.
132+ # Doozer's images:okd rebase/build commands will process whatever images are loaded.
133+ self .group_images = all_group_images
131134 self .build_plan .active_image_count = len (self .group_images )
132135
133136 # Set the image list based on the build strategies
@@ -136,46 +139,6 @@ async def init_build_plan(self):
136139 # Log the initial build plan
137140 self .logger .info ('Initial build plan:\n %s' , self .build_plan )
138141
139- async def _filter_payload_images (self , image_names : list ) -> list :
140- """
141- Filter image list to only include images marked for_payload.
142- Non-payload images will be excluded from rebase, build, and imagestream operations.
143-
144- Arg(s):
145- image_names (list): List of image names to filter
146- Return Value(s):
147- list: Filtered list containing only payload images
148- """
149- ocp_build_data_path = Path (self .runtime .doozer_working ) / 'ocp-build-data' / 'images'
150- payload_images = []
151- non_payload_images = []
152-
153- for image_name in image_names :
154- yaml_file = ocp_build_data_path / f'{ image_name } .yml'
155-
156- try :
157- with open (yaml_file ) as f :
158- image_metadata = yaml .safe_load (f )
159-
160- if image_metadata .get ('for_payload' , False ):
161- payload_images .append (image_name )
162- else :
163- non_payload_images .append (image_name )
164-
165- except Exception as e :
166- self .logger .warning ('Failed to load metadata for %s: %s. Excluding from build.' , image_name , e )
167- non_payload_images .append (image_name )
168-
169- if non_payload_images :
170- self .logger .info (
171- 'Excluding %d non-payload images from pipeline: %s' ,
172- len (non_payload_images ),
173- ', ' .join (non_payload_images ),
174- )
175-
176- self .logger .info ('Pipeline will operate on %d payload images' , len (payload_images ))
177- return payload_images
178-
179142 def check_building_images (self ):
180143 if self .build_plan .image_build_strategy == BuildStrategy .NONE :
181144 jenkins .update_title ('[NO IMAGES]' )
@@ -187,16 +150,16 @@ def check_building_images(self):
187150 jenkins .update_title (f'[{ self .build_plan .active_image_count } ] images' )
188151
189152 elif self .build_plan .image_build_strategy == BuildStrategy .ONLY :
190- # Filter image_list to only include payload images (from self.group_images)
153+ # Filter image_list to only include images that exist in the group
191154 self .build_plan .images_included = [img for img in self .image_list if img in self .group_images ]
192155 self .build_plan .images_excluded = []
193156
194- # Warn if any requested images are not payload images
195- non_payload_requested = [img for img in self .image_list if img not in self .group_images ]
196- if non_payload_requested :
157+ # Warn if any requested images don't exist in the group
158+ non_existent_requested = [img for img in self .image_list if img not in self .group_images ]
159+ if non_existent_requested :
197160 self .logger .warning (
198- 'Requested images are not payload images and will be skipped: %s' ,
199- ', ' .join (non_payload_requested ),
161+ 'Requested images do not exist in the group and will be skipped: %s' ,
162+ ', ' .join (non_existent_requested ),
200163 )
201164
202165 n_images = len (self .build_plan .images_included )
@@ -622,7 +585,11 @@ async def update_imagestreams(self):
622585 continue
623586
624587 # Determine payload tag name
625- # Note: All images in the pipeline are already filtered to be payload images
588+ # Note: Only images with for_payload=true should be tagged into imagestreams
589+ if not image_metadata .get ('for_payload' , False ):
590+ self .logger .debug ('Skipping non-payload image %s from imagestream tagging' , image_name )
591+ continue
592+
626593 payload_tag = self ._get_payload_tag_name (image_name , image_metadata )
627594 image_pullspec = image .get ('image_pullspec' )
628595 image_tag = image .get ('image_tag' )
@@ -773,9 +740,9 @@ def building_images(self):
773740 def include_exclude_param (self ):
774741 """
775742 Returns the include/exclude parameters for the Doozer command based on the image build strategy.
776- Note: self.group_images contains only payload images, and images_included/images_excluded
777- have already been filtered in check_building_images() to only contain payload images.
778- We must always pass explicit -- images parameter to enforce payload-only filtering to doozer .
743+ Note: self.group_images contains all enabled OKD images (including base/parent images).
744+ images_included/images_excluded have already been filtered in check_building_images()
745+ to only contain images that exist in the group .
779746 """
780747
781748 build_strategy = self .build_plan .image_build_strategy
0 commit comments