-
Notifications
You must be signed in to change notification settings - Fork 249
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: 模板文件支持 Helm 语法模式 #3494
feat: 模板文件支持 Helm 语法模式 #3494
Conversation
c0db00c
to
95146f5
Compare
@@ -3409,6 +3409,12 @@ message DeployTemplateFileReq { | |||
string namespace = 5 [(grpc.gateway.protoc_gen_swagger.options.openapiv2_field) = { | |||
title: "命名空间" | |||
}, (validate.rules).string = {min_len : 1, max_len : 64}]; | |||
string grammarMode = 6 [(grpc.gateway.protoc_gen_swagger.options.openapiv2_field) = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
templatefile 版本创建出来就已经有语法模式了,部署这里不用传
@@ -575,6 +595,19 @@ func (t *TemplateAction) DeployTemplateFile(ctx context.Context, req *clusterRes | |||
return nil, err | |||
} | |||
|
|||
// helm 语法模式 | |||
if req.GrammarMode == "Helm" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
语法模式放在 templatefile 里面,类似于 editFormat 一样,前端可以根据语法模式不同展现形式不同。
部署的时候自动从 templatefile 里面读取语法模式
@@ -517,6 +524,19 @@ func (t *TemplateAction) PreviewTemplateFile(ctx context.Context, req *clusterRe | |||
return nil, err | |||
} | |||
|
|||
// helm 语法模式 | |||
if req.GrammarMode == "Helm" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成 RenderMode
95146f5
to
fce11ff
Compare
const ( | ||
// HelmRenderMode helm 语法模式 | ||
HelmRenderMode RenderMode = "Helm" | ||
// SimpleRenderMode 单一语法模式,默认 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
简单语法模式,使用字符串替换渲染
@@ -517,6 +528,16 @@ func (t *TemplateAction) PreviewTemplateFile(ctx context.Context, req *clusterRe | |||
return nil, err | |||
} | |||
|
|||
// helm 语法模式 模板文件内容进行helm template 渲染 | |||
content, errRender := renderHelmTemplate(templates, req.GetValues()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非 helm 语法模式为什么也要用 helm 渲染
a846194
to
3decee1
Compare
@@ -575,6 +598,18 @@ func (t *TemplateAction) DeployTemplateFile(ctx context.Context, req *clusterRes | |||
return nil, err | |||
} | |||
|
|||
// helm 语法模式 模板文件内容进行helm template 渲染 | |||
content, errRender := renderHelmTemplate(templates, req.GetValues()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
7f1e1b3
to
272d703
Compare
* github-bk-bcs/master: feat: 配置示例新增windows路径需求--story=119618143 (#3549) fix: 修复客户端事件列表接口 (#3568) fix: 客户端事件列表过滤跳过的事件数据 (#3558) feat: HTTP接口拉取文件支持设置labels (#3567) feat: 资源视图表单 cronjob 表达式支持正则 (#3540) feat: 模板文件支持 Helm 语法模式 (#3494) feat: cmd命令行缺少空格问题--story=119697737 (#3566) feat: 1.配置示例-配置文件筛选体验优化--story=119697737 (#3565)
feat: 模板文件支持 Helm 语法模式