def METHOD_NAME(request, project_id, cluster_id, ns_name, deployments):
    """通过deployment查询HPA关联信息"""
    hpa_list = get_cluster_hpa_list(request, project_id, cluster_id, namespace=ns_name)
    hpa_deployment_list = [i["ref_name"] for i in hpa_list if i["ref_kind"] == K8sResourceKind.Deployment.value]
    for deployment in deployments:
        if deployment["resourceName"] in hpa_deployment_list:
            deployment["hpa"] = True
        else:
            deployment["hpa"] = False
    return deployments