diff --git a/bcs-app/backend/apps/cluster/flow_views/tools/gse/__init__.py b/bcs-app/backend/apps/cluster/flow_views/tools/gse/__init__.py index 7b8a7c0c0..858cdf874 100644 --- a/bcs-app/backend/apps/cluster/flow_views/tools/gse/__init__.py +++ b/bcs-app/backend/apps/cluster/flow_views/tools/gse/__init__.py @@ -11,17 +11,22 @@ # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the # specific language governing permissions and limitations under the License. # +from typing import Dict, List + from backend.components import gse class GSEClient: @classmethod - def get_agent_status(cls, request, ip_list): + def get_agent_status(cls, username: str, ip_list: List[Dict]) -> List[Dict]: + """""" hosts = [] for info in ip_list: - plat_info = info.get('bk_cloud_id') or [] - plat_id = plat_info[0]['id'] if plat_info else 0 + bk_cloud_id = info.get('bk_cloud_id') or 0 hosts.extend( - [{'plat_id': plat_id, 'bk_cloud_id': plat_id, 'ip': ip} for ip in info.get('inner_ip', '').split(',')] + [ + {'plat_id': bk_cloud_id, 'bk_cloud_id': bk_cloud_id, 'ip': ip} + for ip in info.get('inner_ip', '').split(',') + ] ) - return gse.get_agent_status(request.user.username, hosts) + return gse.get_agent_status(username, hosts) diff --git a/bcs-app/backend/apps/cluster/views/node.py b/bcs-app/backend/apps/cluster/views/node.py index 3f9068093..6ca703503 100644 --- a/bcs-app/backend/apps/cluster/views/node.py +++ b/bcs-app/backend/apps/cluster/views/node.py @@ -520,7 +520,7 @@ def post(self, request, project_id): pagination_data = custom_paginator(host_list, data['offset'], limit=data['limit']) # for frontend display cc_host_map = self.get_cc_host_mappings(pagination_data['results']) - gse_host_status = gse.GSEClient.get_agent_status(request, cc_host_map.values()) + gse_host_status = gse.GSEClient.get_agent_status(request.user.username, cc_host_map.values()) # compose the host list with gse status and host status self.update_agent_status(cc_host_map, gse_host_status) diff --git a/docs/release.md b/docs/release.md index c22ea35c1..38f986955 100644 --- a/docs/release.md +++ b/docs/release.md @@ -1,4 +1,12 @@ # 发布日志 +## release-1.4.5 +#### 修复 +- [#951](https://github.com/Tencent/bk-bcs-saas/pull/951)修复由于CMDB主机列表接口返回字段(bk_cloud_id)类型变动导致的问题 +- [#941](https://github.com/Tencent/bk-bcs-saas/pull/941)修复用户是超级管理员时,项目权限异常的问题 + +#### 优化 +- Mesos允许通过prometheus获取集群和节点metric功能 + ## release-1.4.1 #### 新增