def get_job_selector(job: Job) -> Optional[str]:
    """
    First try to get by controller_uid, then by selectors, and if both not available by name
    """
    job_labels = job.metadata.labels
    controller_uid = job_labels.get(CONTROLLER_UID, None)
    if controller_uid:
        return f"{CONTROLLER_UID}={controller_uid}"

    if job.spec.selector:
        selector = build_selector_query(job.spec.selector)
        if selector:
            return selector

    job_name = job_labels.get("job-name", None)
    if not job_name:
        return None

    return f"job-name={job_name}"

    First try to get by controller_uid, then by selectors, and if both not available by name
    
src/robusta/core/playbooks/job_utils.py