def METHOD_NAME(cls, v: Optional[str], values: Dict[str, Any]) -> Optional[str]:
    """Set the value of ``repo``."""
    if v:
        return v
    image: Optional[DockerImage] = values.get("image")
    if image:
        return image.repo
    ecr_repo: Optional[ElasticContainerRegistryRepository] = values.get("ecr_repo")
    if ecr_repo:
        return ecr_repo.fqn
    return None