Drop unreachable forward-zone addzone config
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

This commit is contained in:
2026-10-16 23:37:56 +11:00
parent 53cb7fa059
commit 651c54cf7f
3 changed files with 9 additions and 30 deletions
+5 -9
View File
@@ -154,7 +154,11 @@ func renderForwardZone(z bindv1alpha1.BindZone, indent string) string {
b.WriteString(fmt.Sprintf("%szone \"%s\" {\n", indent, z.Spec.ZoneName))
b.WriteString(indent + " type forward;\n")
b.WriteString(indent + " forward only;\n")
b.WriteString(indent + " " + ForwardersClause(z.Spec.Forwarders) + ";\n")
if list := terminate(z.Spec.Forwarders); list != "" {
b.WriteString(fmt.Sprintf("%s forwarders { %s };\n", indent, list))
} else {
b.WriteString(indent + " forwarders { };\n")
}
b.WriteString(indent + "};\n")
return b.String()
}
@@ -396,14 +400,6 @@ func terminate(entries []string) string {
return strings.Join(parts, " ")
}
// ForwardersClause renders a zone forwarders clause; empty means "forwarders { }" (no forwarding).
func ForwardersClause(entries []string) string {
if list := terminate(entries); list != "" {
return "forwarders { " + list + " }"
}
return "forwarders { }"
}
func yesno(b bool) string {
if b {
return "yes"