Indented and simplified Corefile template
@@ -249,7 +249,7 @@ func (dns *boshDomainNameService) createCorefile(namespace string) string {
.:8053 {
errors
health
- {{- range $_, $rewrite := .Rewrites }}
+ {{- range $rewrite := . }}
{{ $rewrite }}
{{- end }}
forward . /etc/resolv.conf
@@ -257,11 +257,10 @@ func (dns *boshDomainNameService) createCorefile(namespace string) string {
loop
reload
loadbalance
-}
-`))
+ }`))
var config strings.Builder
- tmpl.Execute(&config, struct{ Rewrites []string }{rewrites})
+ tmpl.Execute(&config, rewrites)
return config.String()
}
