-
Notifications
You must be signed in to change notification settings - Fork 332
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
fix(application): use other path as chart cache path #2317
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ package chartpath | |
|
||
import ( | ||
"tkestack.io/tke/api/application" | ||
applicationv1 "tkestack.io/tke/api/application/v1" | ||
v1 "tkestack.io/tke/api/application/v1" | ||
registryv1 "tkestack.io/tke/api/registry/v1" | ||
"tkestack.io/tke/pkg/application/config" | ||
|
@@ -50,12 +51,6 @@ func FullfillChartInfo(appChart application.Chart, cg registryv1.ChartGroup) (ap | |
} | ||
|
||
// BuildChartPathBasicOptions will judge chartgroup type and return well-structured ChartPathOptions | ||
func BuildChartPathBasicOptions(repo config.RepoConfiguration, appChart application.Chart) (opt helmaction.ChartPathOptions, err error) { | ||
var v1Chart = &v1.Chart{} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 54部分需要去掉吗? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 去掉了,这部分就是为了构建后面的path,用不到了 |
||
err = v1.Convert_application_Chart_To_v1_Chart(&appChart, v1Chart, nil) | ||
if err != nil { | ||
return opt, err | ||
} | ||
|
||
return chartpathv1.BuildChartPathBasicOptions(repo, *v1Chart) | ||
func BuildChartPathBasicOptions(repo config.RepoConfiguration, app *applicationv1.App) (opt helmaction.ChartPathOptions, err error) { | ||
return chartpathv1.BuildChartPathBasicOptions(repo, app) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,8 @@ func FullfillChartInfo(appChart v1.Chart, cg registryv1.ChartGroup) (v1.Chart, e | |
} | ||
|
||
// BuildChartPathBasicOptions will judge chartgroup type and return well-structured ChartPathOptions | ||
func BuildChartPathBasicOptions(repo config.RepoConfiguration, appChart v1.Chart) (opt helmaction.ChartPathOptions, err error) { | ||
func BuildChartPathBasicOptions(repo config.RepoConfiguration, app *v1.App) (opt helmaction.ChartPathOptions, err error) { | ||
appChart := app.Spec.Chart | ||
if appChart.ImportedRepo { | ||
password, err := registryutil.VerifyDecodedPassword(appChart.RepoPassword) | ||
if err != nil { | ||
|
@@ -63,7 +64,7 @@ func BuildChartPathBasicOptions(repo config.RepoConfiguration, appChart v1.Chart | |
opt.Password = repo.AdminPassword | ||
} | ||
|
||
opt.ChartRepo = appChart.TenantID + "/" + appChart.ChartGroupName | ||
opt.ChartRepo = appChart.TenantID + "/" + app.Spec.TargetCluster + "-" + app.Spec.TargetNamespace + "/" + appChart.ChartGroupName | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里使用 appChart.ChartName 是否更好。ChartGroupName 都是local There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 后面解压缩的时候,会用chart的名字做为文件夹的名字的 |
||
opt.Chart = appChart.ChartName | ||
opt.Version = appChart.ChartVersion | ||
return opt, nil | ||
|
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.
这部分不需要了吗?
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.
不要了,这部分转化就是为了构建后面的path,用不到了