@@ -190,20 +190,29 @@ def create_codebase_resources(project, image: Image) -> None:
190190 for layer_index , layer in enumerate (image .layers , start = 1 ):
191191 layer_tag = get_layer_tag (image .image_id , layer .layer_id , layer_index )
192192
193- pipes .make_codebase_resource (
194- project = project ,
195- location = str (layer .extracted_location ),
196- tag = layer_tag ,
197- extra_data = {"layer" : {"created_by" : layer .created_by }},
198- )
199-
193+ layer_file_count = 0
200194 for resource in layer .get_resources (with_dir = True ):
201195 pipes .make_codebase_resource (
202196 project = project ,
203197 location = resource .location ,
204198 rootfs_path = resource .path ,
205199 tag = layer_tag ,
206200 )
201+ if resource .is_file :
202+ layer_file_count += 1
203+
204+ layer_data = layer .to_dict ()
205+ layer_data ["file_count" ] = layer_file_count
206+ layer_data .pop ("extracted_location" , None )
207+ layer_data .pop ("archive_location" , None )
208+
209+ pipes .make_codebase_resource (
210+ project = project ,
211+ location = str (layer .extracted_location ),
212+ tag = layer_tag ,
213+ # Store the layer data in the extra_data for display in the UI
214+ extra_data = {"layer" : layer_data },
215+ )
207216
208217
209218def create_system_package (project , purl , package , layer , layer_tag ):
0 commit comments