def related_pods(event: KubernetesResourceEvent, params: RelatedPodParams):
    """
    Return the list of pods related to that k8s resource.
    For example, return all pods of a given k8s Deployment

    Supports Deployments, ReplicaSets, DaemonSets, StatefulSets and Pods
    """
    cluster = event.get_context().cluster_name

    if params.output_format == "json":
        pods = get_related_pods(event.get_resource(), limit=params.limit)
        event.add_enrichment([JsonBlock(json.dumps([to_pod_obj(pod, cluster, include_raw_data=params.include_raw_data).dict() for pod in pods], default=str))])
    else:
        pods = get_related_pods(event.get_resource(), limit=params.limit)
        rows = [to_pod_row(pod, cluster) for pod in pods]
        event.add_enrichment(
            [
                TableBlock(
                    table_name="related pods",
                    headers=[
                        "name",
                        "namespace",
                        "cluster",
                        "node",
                        "cpu limit",
                        "cpu request",
                        "memory limit",
                        "memory request",
                        "creation_time",
                        "restarts",
                        "addresses",
                        "containers",
                        "status",
                        "status reason",
                    ],
                    rows=rows,
                )
            ]
        )

    Return the list of pods related to that k8s resource.
    For example, return all pods of a given k8s Deployment

    Supports Deployments, ReplicaSets, DaemonSets, StatefulSets and Pods
    
playbooks/robusta_playbooks/k8s_resource_enrichments.py