Skip to content

Commit

Permalink
fix(backend): 兼容修复服务实例创建判断的问题 #3114
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 2072
  • Loading branch information
zhangzhw8 committed Jan 19, 2024
1 parent 46b1838 commit 111906e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions dbm-ui/backend/db_services/cmdb/biz.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import logging
from typing import List

from backend import env
from backend.components import CCApi
from backend.db_meta.models import AppCache, DBModule
from backend.db_services.cmdb.exceptions import BkAppAttrAlreadyExistException
Expand Down Expand Up @@ -138,7 +137,7 @@ def get_or_create_cmdb_module_with_name(bk_biz_id: int, bk_set_id: int, bk_modul

res = CCApi.create_module(
{
"bk_biz_id": env.DBA_APP_BK_BIZ_ID,
"bk_biz_id": bk_biz_id,
"bk_set_id": bk_set_id,
"data": {"bk_parent_id": bk_set_id, "bk_module_name": bk_module_name},
},
Expand Down
7 changes: 4 additions & 3 deletions dbm-ui/backend/flow/utils/cc_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,17 @@ def add_service_instance(
"""
# 检查主机的服务实例,若已存在,则不新建
service_instances = CCApi.list_service_instance_detail(
{"bk_biz_id": self.hosting_biz_id, "bk_host_list": [bk_host_id], "page": {"start": 0, "limit": 200}}
{"bk_biz_id": self.hosting_biz_id, "bk_host_list": [bk_host_id], "page": {"start": 0, "limit": 1000}}
)["info"]
for ins in service_instances:
for process in ins.get("process_instances") or []:
bind_info = process["process"]["bind_info"] or [{"ip": "", "port": ""}]
if all(
[
process["process"]["bk_func_name"] == func_name,
process["process"]["bk_process_name"] == bk_process_name,
process["process"]["bind_info"][0]["ip"] == listen_ip,
process["process"]["bind_info"][0]["port"] == str(listen_port),
bind_info[0]["ip"] == listen_ip,
bind_info[0]["port"] == str(listen_port),
]
):
# 如果服务实例已存在,则只更新其标签即可
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ description: A Helm chart for bk-dbm
name: bk-dbm
type: application
version: 1.3.0-alpha.37
appVersion: 1.3.0-alpha.37
appVersion: 1.3.0-alpha.37
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/db-simulation/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.0.1-alpha.46
appVersion: 0.0.1-alpha.47
description: A Helm chart for Kubernetes
name: db-simulation
type: application
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 1.3.0-alpha.330
appVersion: 1.3.0-alpha.335
description: A Helm chart for dbm
name: dbm
type: application
Expand Down

0 comments on commit 111906e

Please sign in to comment.