Skip to content

Commit

Permalink
fix: fix(backend): spider工具箱问题修复 #1251
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud committed Oct 7, 2023
1 parent f6da5de commit 994f89f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dbm-ui/backend/configuration/views/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def sensitive_environ(self, request):
"MONITOR_EVENT_DATA_ID": dbm_report["event"]["data_id"],
"MONITOR_METRIC_ACCESS_TOKEN": dbm_report["metric"]["token"],
"MONITOR_EVENT_ACCESS_TOKEN": dbm_report["event"]["token"],
"MONITOR_SERVICE": domains.BKMONITORV3_APIGW_DOMAIN,
"MONITOR_SERVICE": dbm_report["proxy"],
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from backend.db_meta.exceptions import DBMetaException
from backend.db_meta.models import Cluster, ClusterEntry, StorageInstanceTuple
from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig
from backend.flow.utils.cc_manage import CcManage

logger = logging.getLogger("root")
Expand Down Expand Up @@ -59,6 +60,8 @@ def decommission(cluster: Cluster):
# todo 目前cc没有封装移除主机模块接口,先保留写法
# delete_cluster_modules(db_type=DBType.MySQL.value, del_cluster_id=cluster.id)
cluster.delete(keep_parents=True)
# 删除集群相关的配置模板
TendbOpenAreaConfig.objects.filter(source_cluster_id=cluster.id).delete()


@transaction.atomic
Expand Down
3 changes: 3 additions & 0 deletions dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from backend.configuration.constants import DBType
from backend.db_meta.exceptions import DBMetaException
from backend.db_meta.models import Cluster, ClusterEntry, StorageInstanceTuple
from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig
from backend.flow.utils.cc_manage import CcManage

logger = logging.getLogger("root")
Expand Down Expand Up @@ -55,6 +56,8 @@ def decommission(cluster: Cluster):
# TODO CC 目前没有把主机移出当前模块的接口,主机还在模块下,无法删除
# cc_manage.delete_cluster_modules(db_type=DBType.MySQL.value, cluster=cluster)
cluster.delete(keep_parents=True)
# 删除集群相关的配置模板
TendbOpenAreaConfig.objects.filter(source_cluster_id=cluster.id).delete()


@transaction.atomic
Expand Down
5 changes: 1 addition & 4 deletions dbm-ui/backend/db_proxy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ def get_latest_extension(cls, bk_cloud_id: int, extension_type: ExtensionType) -
@classmethod
def get_extension_access_hosts(cls, bk_cloud_id: int, extension_type: ExtensionType):
extensions = cls.get_extension_in_cloud(bk_cloud_id, extension_type)
if extension_type == ExtensionType.DBHA:
extensions = extensions.filter(details__dbha_type=CloudDBHATypeEnum.AGENT)

access_hosts = [ext.details["ip"] for ext in extensions]
access_hosts = list(set([ext.details["ip"] for ext in extensions]))
return access_hosts

@classmethod
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/backend/db_services/mysql/open_area/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def _get_custom_permissions(self):
return [DBManageIAMPermission()]

def get_queryset(self):
# 过滤业务下的集群模板
bk_biz_id = self.request.parser_context["kwargs"].get("bk_biz_id")
return self.queryset.filter(bk_biz_id=bk_biz_id)

Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ChecksumDataInfoSerializer(serializers.Serializer):

runtime_hour = serializers.IntegerField(help_text=_("超时时间"))
timing = serializers.CharField(help_text=_("定时触发时间"))
infos = serializers.ListField(help_text=_("全备信息列表"), child=ChecksumDataInfoSerializer())
infos = serializers.ListField(help_text=_("数据校验信息列表"), child=ChecksumDataInfoSerializer())
data_repair = serializers.DictField(help_text=_("数据修复信息"))
is_sync_non_innodb = serializers.BooleanField(help_text=_("非innodb表是否修复"), required=False, default=False)

Expand Down
4 changes: 2 additions & 2 deletions helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ dependencies:
description: A Helm chart for bkdbm
name: bk-dbm
type: application
version: 1.2.0-alpha.40
appVersion: 1.2.0-alpha.40
version: 1.2.0-alpha.41
appVersion: 1.2.0-alpha.41
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: dev-1.2.0-alpha.95
appVersion: dev-1.2.0-alpha.102
description: A Helm chart for dbm
name: dbm
type: application
Expand Down

0 comments on commit 994f89f

Please sign in to comment.