fix(generation): use tpl in note for hostnames

The value in hostname in values file can be a templated string. So, we
should execute the content.
This commit is contained in:
2024-10-24 17:21:04 +02:00
parent d31993953b
commit db168c91c9

View File

@@ -15,7 +15,7 @@ func NotesFile(services []string) string {
ingresses := make([]string, len(services))
for i, service := range services {
condition := fmt.Sprintf(`{{- if and .Values.%[1]s.ingress .Values.%[1]s.ingress.enabled }}`, service)
line := fmt.Sprintf(`{{- $count = add1 $count -}}{{- $listOfURL = printf "%%s\n- http://%%s" $listOfURL .Values.%s.ingress.host -}}`, service)
line := fmt.Sprintf(`{{- $count = add1 $count -}}{{- $listOfURL = printf "%%s\n- http://%%s" $listOfURL (tpl .Values.%s.ingress.host .) -}}`, service)
ingresses[i] = fmt.Sprintf("%s\n%s\n{{- end }}", condition, line)
}