feat: 支持命名空间多资源配额的查询与前端展示#3859
Merged
evanlixin merged 2 commits intoJul 13, 2026
Merged
Conversation
adevjoe
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能概述
命名空间下可能存在多个
ResourceQuota对象。本 PR 实现了查询并返回该命名空间下除默认同名配额(Default Quota)之外的其他配额(Other Quotas)信息,并在前端命名空间详情页中提供独立的“其他配额”标签页进行展示。主要变更
1. Proto 协议定义
bcsproject.proto的NamespaceData消息体中增加了otherQuotas字段以及OtherQuota的消息格式,并重新生成了 pb 接口文件。2. 后端服务 (
bcs-project-manager)independent/get.go&shared/get.go):重构了
getNamespaceQuota查询方法。采用List方式一次性获取所有配额并过滤分类;恢复并保证了对errors.IsNotFound(err)的错误容错处理。independent/list.go&shared/list.go):优化批量查询时的内存映射,支持在列表接口中聚合返回各命名空间的其他配额列表。
quota.go):新增
TransferToProtoOtherQuota,实现 K8s 原生ResourceQuota向 proto 结构体的转换。3. 前端界面 (
bcs-ui)detail.vue):当存在其他配额时,在命名空间详情页渲染“其他配额” Tab,并以表格形式展示配额名称、CPU Limit/Request、Memory Limit/Request。
在
zh-CN.yaml与en-US.yaml中补充了“其他配额 / Other Quotas”的翻译键值对。