cluster: addons as list

This commit is contained in:
Mikaël Cluseau
2023-05-15 14:47:53 +02:00
parent 76c1861017
commit 74abbf9eda
3 changed files with 23 additions and 15 deletions

View File

@ -102,21 +102,23 @@ func FromDir(
// cluster addons
for _, cluster := range config.Clusters {
addonSet := cluster.Addons
if len(addonSet) == 0 {
addonSets := cluster.Addons
if len(addonSets) == 0 {
continue
}
if _, ok := config.Addons[addonSet]; ok {
continue
}
for _, addonSet := range addonSets {
if _, ok := config.Addons[addonSet]; ok {
continue
}
templates := make([]*Template, 0)
if err = loadTemplates(path.Join("addons", addonSet), &templates); err != nil {
return nil, err
}
templates := make([]*Template, 0)
if err = loadTemplates(path.Join("addons", addonSet), &templates); err != nil {
return nil, err
}
config.Addons[addonSet] = templates
config.Addons[addonSet] = templates
}
}
// cluster bootstrap pods