values overwrite

This commit is contained in:
admju
2024-09-11 13:40:40 +00:00
parent 9561dc5493
commit c1134f7403
7 changed files with 100 additions and 79 deletions

36
src/install/generate.go Normal file
View File

@@ -0,0 +1,36 @@
package install
import (
"fmt"
"path/filepath"
log "oc-deploy/log_wrapper"
"oc-deploy/utils"
"oc-deploy/chart"
)
func (this *InstallClass) NewGenerate() (string, error) {
// Extraction du fichier de la version
dst, err := this.extractVersion()
if err != nil {
return "", err
}
this.charts, _ = chart.FromConfigFile(dst)
if err != nil {
return dst, err
}
for _, ele1 := range this.charts {
for _, ele2 := range ele1.Charts {
filename := filepath.Join(this.Workspace, fmt.Sprintf("values-%s.yml", ele2.Name) )
utils.CopyContentFile(ele2.Overwrite, filename)
log.Log().Info().Msg(fmt.Sprintf(">> %s : %s", ele2.Name, filename))
}
}
return dst, nil
}