Ejemplo n.º 1
0
def update_bcs_service_for_project(request, project_id, data):
    username = request.user.username
    create_bkrepo_project_and_depot(request.project, username)
    logger.info(f'init_template [update] project_id: {project_id}')
    init_template.delay(project_id, request.project.english_name,
                        request.user.token.access_token, request.user.username)
    # helm handler
    K8SDriver.backend_create_helm_info(project_id)
    notify_manager.delay(
        _("用户[{}]在项目{}下启用了容器服务,请关注").format(username,
                                            request.project.project_name))
Ejemplo n.º 2
0
def update_bcs_service_for_project(request, project_id, data):
    backend_create_depot_path(request, project_id, request.project.cc_app_id)
    logger.info(f'init_template [update] project_id: {project_id}')
    init_template.delay(project_id, request.project.english_name,
                        request.user.token.access_token, request.user.username)
    # helm handler
    K8SDriver.backend_create_helm_info(project_id)
    notify_manager.delay(
        '{prefix_msg}[{username}]{project}{project_name}{suffix_msg}'.format(
            prefix_msg=_("用户"),
            username=request.user.username,
            project=_("在项目"),
            project_name=request.project.project_name,
            suffix_msg=_("下启用了容器服务,请关注"),
        ))
Ejemplo n.º 3
0
def update_bcs_service_for_project(request, project_id, data):
    backend_create_depot_path(request, project_id, request.project.cc_app_id)
    expected_kind = data.get('kind')
    # 当需要变动调度类型,并且和先前不一样时,需要初始化模板
    if (not expected_kind) or (expected_kind == request.project.kind):
        return
    logger.info(f'init_template [update] project_id: {project_id}')
    init_template.delay(project_id, request.project.english_name,
                        expected_kind, request.user.token.access_token,
                        request.user.username)
    # helm handler
    BaseDriver(expected_kind).driver.backend_create_helm_info(project_id)
    notify_manager.delay(
        '{prefix_msg}[{username}]{project}{project_name}{suffix_msg}'.format(
            prefix_msg=_("用户"),
            username=request.user.username,
            project=_("在项目"),
            project_name=request.project.project_name,
            suffix_msg=_("下启用了容器服务,请关注")))