def profile_exists()

in lambdas/kf_profile_manager/index.py [0:0]


def profile_exists(name, api):
    custom_objects = api.list_cluster_custom_object(
        group="kubeflow.org",
        version="v1",
        plural="profiles",
        pretty="true"
    )
    for item in custom_objects['items']:
        if item['spec']['owner']['name'] == name:
            logger.info(f"FOUND profile name={name}")
            return True
    logger.info(f"Profile name={name} not yet found")
    return False