Skip to content

Commit

Permalink
fix(backend): 资源池申请增加localtion参数 #2326
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud authored and zhangzhw8 committed Dec 4, 2023
1 parent 55e6a86 commit 6c7d405
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dbm-ui/backend/db_meta/models/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def capacity(self):
def get_apply_params_detail(self, group_mark, count, bk_cloud_id, affinity=AffinityEnum.NONE, location_spec=None):
# 获取资源申请的detail过程,暂时忽略亲和性和位置参数过滤
spec_offset = SystemSettings.get_setting_value(SystemSettingsEnum.SPEC_OFFSET)
return {
apply_params = {
"group_mark": group_mark,
"bk_cloud_id": bk_cloud_id,
"device_class": self.device_class,
Expand All @@ -103,8 +103,11 @@ def get_apply_params_detail(self, group_mark, count, bk_cloud_id, affinity=Affin
],
"count": count,
"affinity": affinity,
"location_spec": location_spec,
}
if location_spec:
apply_params["location_spec"] = location_spec

return apply_params

def get_backend_group_apply_params_detail(self, bk_cloud_id, backend_group):
# 专属于后端:如果一组master/slave有特殊要求,则采用backend_group申请
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/backend/ticket/flow_manager/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def fetch_apply_params(self, ticket_data):
count=int(role_spec["count"]),
bk_cloud_id=bk_cloud_id,
affinity=role_spec.get("affinity", AffinityEnum.NONE.value),
location_spec=role_spec.get("location_spec"),
)
)

Expand Down

0 comments on commit 6c7d405

Please sign in to comment.