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

feat:bcs-helm-manager release 列表接口进一步优化 #3063

Merged
merged 2 commits into from
May 31, 2024

Conversation

LidolLxf
Copy link
Contributor

feat:bcs-helm-manager release 列表接口进一步优化

}

// 获取版本号,string->int
func getVersion(s string) int {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 parseVersion

}

// Unix字符串转换
func getTime(s string) time.Time {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 parseStringUnixTime

bearerToken := options.GlobalOptions.Release.Token
url := fmt.Sprintf("%s/clusters/%s/api/v1/namespaces/%s/secrets?%s", apiServer, c.clusterID, option.Namespace,
"labelSelector=owner=helm,status!=superseded")
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http client 使用类似 bcs-monitor 里面的 http client,有封装好的,可以移植过来

"github.com/Tencent/bk-bcs/bcs-services/bcs-helm-manager/internal/release"
"github.com/Tencent/bk-bcs/bcs-services/bcs-helm-manager/internal/store/entity"
)

func (c *cluster) list(ctx context.Context, option release.ListOption) (int, []*release.Release, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以新增一个 grpc 接口,和以前的 release list 接口区分开来,因为前端还没有改,先做兼容

@LidolLxf LidolLxf force-pushed the feat_release_secret branch 2 times, most recently from 2d26e95 to 7b885ad Compare April 2, 2024 02:46
return nil
}

func (l *ListReleaseV2Action) list() (*helmmanager.ReleaseListData, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只是拉取集群里的 release 不同,看其他的能不能复用

package entity

// SecretList is a list of Secret.
type SecretList struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secret 可以引用 k8s 的库,不用 copy 一份放这里

@ifooth ifooth merged commit 56624c8 into TencentBlueKing:master May 31, 2024
11 checks passed
wenxinlee2015 added a commit that referenced this pull request Jun 4, 2024
* github-bk-bcs/master:
  fix: 客户端标签图表维度数据前端缓存 (#3252)
  fix: 修复配置项冲突计算错误 (#3249)
  fix: 修复客户端标签与实际不一致 (#3248)
  feat:bcs-monitor 删除 bcslogconfig 兼容代码 (#3241)
  feat:新增trace init公共方法及文件配置参数 (#3202)
  feat:bcs-helm-manager release 列表接口进一步优化 (#3063)
  fix: 客户端查询,客户端统计,批量导入问题修复 (#3247)
  fix: 修复导入配置模版失败 (#3246)
  服务管理相关的测试问题修复 (#3245)
  fix: 客户端查询支持失败主类搜索以及验证空间套餐下之间的冲突 (#3243)
  fix: 客户端统计和批量导入bug修复 (#3244)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants