def METHOD_NAME(
    component_descriptor_v2: gci.componentmodel.ComponentDescriptor,
    filter_function,
    clamav_client: clamav.client.ClamAVClient,
    oci_client: oc.Client=None,
    max_workers=8,
) -> typing.Generator[clamav.model.MalwareScanResult, None, None]:
    '''Scans components of the given Component Descriptor using ClamAV
    Used by image-scan-trait
    '''
    resources = [
        resource for component, resource
        in product.v2.enumerate_oci_resources(component_descriptor=component_descriptor_v2)
        if filter_function(component, resource)
    ]
    logger.info(f'will scan {len(resources)=} OCI Images')
    try_scan_func = functools.partial(
        _try_scan_image,
        clamav_client=clamav_client,
        oci_client=oci_client,
    )
    executor = concurrent.futures.ThreadPoolExecutor(max_workers=max_workers)
    results = executor.map(
        try_scan_func,
        resources,
    )
    yield from results