def resource_babysitter(event: KubernetesAnyChangeEvent, config: BabysitterConfig):
    """
    Track changes to a k8s resource.
    Send the diff as a finding
    """
    if not event.obj.metadata:  # shouldn't happen, just to be on the safe side
        logging.warning(f"resource_babysitter skipping resource with no meta - {event.obj}")
        return

    if not isinstance(getattr(event, "filtered_diffs"), list):
        logging.warning(f"resource_babysitter running for an unsupported event type {event.__class__.__name__}")
        return

    if event.obj.metadata.namespace in config.ignored_namespaces:
        return

    if (
        event.operation == K8sOperationType.DELETE
    ):  # On delete, the current obj should be None, and not the actual object, as received
        old_obj = event.obj_filtered
        obj = None
    else:
        old_obj = event.old_obj_filtered
        obj = event.obj_filtered

    should_get_subject_node_name = isinstance(event, NodeChangeEvent)
    # we take it from the original event, in case metadata is omitted
    meta = event.obj.metadata
    diff_block = KubernetesDiffBlock(
        event.filtered_diffs, old_obj, obj, meta.name, kind=event.obj.kind, namespace=meta.namespace
    )
    finding = Finding(
        title=f"{diff_block.resource_name} {event.operation.value}d",
        description=diff_block.get_description(),
        source=FindingSource.KUBERNETES_API_SERVER,
        finding_type=FindingType.CONF_CHANGE,
        failure=False,
        aggregation_key=FindingAggregationKey.CONFIGURATION_CHANGE_KUBERNETES_RESOURCE_CHANGE.value,
        subject=KubeObjFindingSubject(event.obj, should_add_node_name=should_get_subject_node_name),
    )
    finding.add_enrichment(
        [diff_block],
        annotations={"operation": event.operation},
        enrichment_type=EnrichmentType.diff,
        title="Kubernetes Manifest Change",
    )
    event.add_finding(finding)

    Track changes to a k8s resource.
    Send the diff as a finding
    
playbooks/robusta_playbooks/babysitter.py