Files
katenary/helm/notes.go

26 lines
603 B
Go
Raw Normal View History

2021-11-30 15:35:32 +01:00
package helm
import "strings"
var NOTES = `
Congratulations,
Your application is now deployed. This may take a while to be up and responding.
__list__
`
// GenerateNotesFile generates the notes file for the helm chart.
func GenerateNotesFile(ingressess map[string]*Ingress) string {
2021-11-30 15:35:32 +01:00
list := make([]string, 0)
for name, ing := range ingressess {
for _, r := range ing.Spec.Rules {
2021-12-01 13:59:41 +01:00
list = append(list, "{{ if .Values."+name+".ingress.enabled -}}\n- "+name+" is accessible on : http://"+r.Host+"\n{{- end }}")
2021-11-30 15:35:32 +01:00
}
}
return strings.ReplaceAll(NOTES, "__list__", strings.Join(list, "\n"))
}