helm : fichiers multiples + variable

This commit is contained in:
admju
2024-09-11 13:13:28 +00:00
parent c7f8503fb6
commit 279f93224f
5 changed files with 21 additions and 12 deletions

View File

@@ -20,8 +20,8 @@ type HelmChart struct {
Workspace string
Opts string
Values string
FileValues string
Values map[string]string
FileValues []string
}
type installInfoOutput struct {
@@ -66,8 +66,12 @@ func (this HelmCommand) ChartInstall(data HelmChart) (string, error) {
msg = fmt.Sprintf("%s --version %s", msg, data.Version)
}
if data.FileValues != "" {
fic := filepath.Join(data.Workspace, data.FileValues)
for key, value := range data.Values {
msg = fmt.Sprintf("%s --set %s=%s", msg, key, value)
}
for _, valuefilename := range data.FileValues {
fic := filepath.Join(data.Workspace, valuefilename)
if _, err := os.Stat(fic); err != nil {
log.Log().Warn().Msg(fic)
} else {