Selection des charts
This commit is contained in:
@@ -89,7 +89,7 @@ func (this *InstallClass) ChartRepo() (error) {
|
||||
}
|
||||
|
||||
|
||||
func (this *InstallClass) InstallCharts() (error) {
|
||||
func (this *InstallClass) InstallCharts(modules []string) (error) {
|
||||
helm_bin, _ := this.getToolBin("helm")
|
||||
kubectl_bin, _ := this.getToolBin("kubectl")
|
||||
|
||||
@@ -97,19 +97,30 @@ func (this *InstallClass) InstallCharts() (error) {
|
||||
|
||||
for _, v := range this.charts {
|
||||
for _, v1 := range v.Charts {
|
||||
wg.Add(1)
|
||||
if len(modules) == 0 || stringInSlice(v1.Name, modules) {
|
||||
wg.Add(1)
|
||||
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
this.installChart(helm_bin, kubectl_bin, v1)
|
||||
} ()
|
||||
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
this.installChart(helm_bin, kubectl_bin, v1)
|
||||
} ()
|
||||
}
|
||||
}
|
||||
}
|
||||
wg.Wait()
|
||||
return nil
|
||||
}
|
||||
|
||||
func stringInSlice(a string, list []string) bool {
|
||||
for _, b := range list {
|
||||
if b == a {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
func (this *InstallClass) installChart(helm_bin string, kubectl_bin string, chart chart.ChartData) {
|
||||
|
||||
log.Log().Info().Msg(fmt.Sprintf(" << Chart : %s ", chart.Name))
|
||||
|
||||
Reference in New Issue
Block a user