Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backend): 更新dbconfig #1658 #1676

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dbm-ui/backend/configuration/models/function_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class CustomFuncNameEnum(str, StructuredEnum):
CustomFuncNameEnum.ToolBox.value: {"is_enabled": True},
ClusterType.TenDBSingle.value: {"is_enabled": True},
ClusterType.TenDBHA.value: {"is_enabled": True},
ClusterType.TenDBCluster.value: {"is_enabled": False},
CustomFuncNameEnum.TenDBClusterToolBox.value: {"is_enabled": False},
ClusterType.TenDBCluster.value: {"is_enabled": True},
CustomFuncNameEnum.TenDBClusterToolBox.value: {"is_enabled": True},
},
},
DBType.Redis.value: {
Expand All @@ -44,7 +44,7 @@ class CustomFuncNameEnum(str, StructuredEnum):
ClusterType.TendisPredixyTendisplusCluster.value: {"is_enabled": True},
ClusterType.TendisTwemproxyRedisInstance.value: {"is_enabled": True},
ClusterType.TwemproxyTendisSSDInstance.value: {"is_enabled": True},
CustomFuncNameEnum.ToolBox.value: {"is_enabled": False},
CustomFuncNameEnum.ToolBox.value: {"is_enabled": True},
},
},
CustomFuncNameEnum.BigData.value: {
Expand All @@ -64,11 +64,11 @@ class CustomFuncNameEnum(str, StructuredEnum):
},
},
CustomFuncNameEnum.Monitor.value: {
"is_enabled": False,
"is_enabled": True,
"children": {
"monitor_policy": {"is_enabled": False},
"monitor_policy": {"is_enabled": True},
"duty_rule": {"is_enabled": False},
"notice_group": {"is_enabled": False},
"notice_group": {"is_enabled": True},
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/backend/ticket/builders/riak/riak_shrink.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def format_ticket_data(self):
self.ticket_data["bk_cloud_id"] = cluster.bk_cloud_id


@builders.BuilderFactory.register(TicketType.RIAK_CLUSTER_DISABLE, phase=ClusterPhase.OFFLINE)
@builders.BuilderFactory.register(TicketType.RIAK_CLUSTER_SCALE_IN, phase=ClusterPhase.OFFLINE)
class RiakShrinkFlowBuilder(BaseRiakTicketFlowBuilder):
serializer = RiakShrinkDetailSerializer
inner_flow_builder = RiakShrinkFlowParamBuilder
Expand Down
22 changes: 15 additions & 7 deletions dbm-ui/blueking/component/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
except Exception: # pylint: disable=broad-except
pass


logger = logging.getLogger("component")


Expand Down Expand Up @@ -89,9 +88,7 @@ def get_bk_api_ver(self):

def merge_params_data_with_common_args(self, method, params, data, enable_app_secret=False):
"""get common args when request"""
common_args = dict(bk_app_code=self.app_code, **self.common_args)
if enable_app_secret:
common_args["bk_app_secret"] = self.app_secret
common_args = dict(**self.common_args)
if method == "GET":
_params = common_args.copy()
_params.update(params or {})
Expand All @@ -110,8 +107,19 @@ def request(self, method, url, params=None, data=None, **kwargs):
headers["x-use-test-env"] = "1"
if self.language:
headers["blueking-language"] = self.language

params, data = self.merge_params_data_with_common_args(method, params, data, enable_app_secret=True)
headers.update({
"X-Bkapi-Authorization": json.dumps(
{
"bk_app_code": self.app_code,
"bk_app_secret": self.app_secret,
"bk_username": params.get("bk_username", ""),
"bk_token": params.get("bk_token", ""),
"bk_ticket": params.get("bk_ticket", ""),
}
)
})

params, data = self.merge_params_data_with_common_args(method, params, data)
logger.debug("Calling %s %s with params=%s, data=%s, headers=%s", method, url, params, data, headers)
return requests.request(method, url, params=params, data=data, verify=False, headers=headers, **kwargs)

Expand All @@ -137,7 +145,7 @@ def request(self, method, url, params=None, data=None, **kwargs):
if self.language:
headers["blueking-language"] = self.language

params, data = self.merge_params_data_with_common_args(method, params, data, enable_app_secret=False)
params, data = self.merge_params_data_with_common_args(method, params, data)
if method == "POST":
params = {}

Expand Down
5 changes: 4 additions & 1 deletion dbm-ui/config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@
"formatter": "bk_audit.contrib.django.formatters.DjangoFormatter",
}

# APIGW配置
# BAMBOO PIPELINE 配置
AUTO_UPDATE_COMPONENT_MODELS = False

# APIGW 蓝鲸网关配置
BK_APIGW_STATIC_VERSION = env.BK_APIGW_STATIC_VERSION
BK_APIGW_MANAGER_MAINTAINERS = env.BK_APIGW_MANAGER_MAINTAINERS
BK_APIGW_STAGE_NAME = env.BK_APIGW_STAGE_NAME
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 @@ -79,5 +79,5 @@ dependencies:
description: A Helm chart for bkdbm
name: bk-dbm
type: application
version: 1.2.0-alpha.79
appVersion: 1.2.0-alpha.79
version: 1.2.0-alpha.80
appVersion: 1.2.0-alpha.80
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbconfig/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.0.1-alpha.51
appVersion: 0.0.1-alpha.52
description: A Helm chart for dbconfig
name: dbconfig
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.2.0-alpha.450
appVersion: 1.2.0-alpha.451
description: A Helm chart for dbm
name: dbm
type: application
Expand Down
Loading