Correction chart via repo

This commit is contained in:
admju 2024-09-18 08:41:47 +00:00
parent ebf9d3fc6d
commit 19790f61e2

View File

@ -60,13 +60,15 @@ func (this *InstallClass) InstallCharts(modules []string) (error) {
var wg sync.WaitGroup
for _, v := range this.charts {
repoName := v.Repository.Name
for _, v1 := range v.Charts {
if len(modules) == 0 || utils.StringInSlice(v1.Name, modules) {
wg.Add(1)
go func() {
defer wg.Done()
this.installChart(v1)
this.installChart(repoName, v1)
} ()
}
}
@ -75,12 +77,19 @@ func (this *InstallClass) InstallCharts(modules []string) (error) {
return nil
}
func (this *InstallClass) installChart(chart chart.ChartData) {
func (this *InstallClass) installChart(repoName string, chart chart.ChartData) {
log.Log().Info().Msg(fmt.Sprintf(" << Chart : %s ", chart.Name))
chartName := chart.Chart
if chartName == "" {
chartName = chart.Name
}
if repoName != "" {
chartName = fmt.Sprintf("%s/%s", repoName, chartName)
}
data := helm.HelmChart{Name: chart.Name,
Chart: chart.Chart,
Chart: chartName,
Url: chart.Url,
Version: chart.Version,
Workspace: this.Workspace,