Exemple #1
0
def get_real_category(project_kind, category):
    if category not in CATE_SHOW_NAME.values():
        return category
    project_kind_name = ClusterType.get(project_kind)
    if project_kind_name == 'Kubernetes':
        category = 'K8s%s' % category
    elif project_kind_name == 'Mesos':
        category = category.lower()
    return category
Exemple #2
0
def to_bcs_res_name(project_kind, origin_name):
    if origin_name not in CATE_SHOW_NAME.values():
        return origin_name
    if project_kind == ProjectKind.K8S.value:
        return f'K8s{origin_name}'
    return origin_name.lower()