mirror of
https://github.com/coredns/coredns.git
synced 2025-12-07 02:45:11 -05:00
fix(plugin/secondary): make transfer property mandatory (#7249)
* fix(plugin/secondary): make transfer property mandatory Signed-off-by: wafuwafu13 <jaruwafu@gmail.com>
This commit is contained in:
committed by
GitHub
parent
427b406300
commit
328165de1e
@@ -72,6 +72,7 @@ func secondaryParse(c *caddy.Controller) (file.Zones, error) {
|
||||
names = append(names, origins[i])
|
||||
}
|
||||
|
||||
hasTransfer := false
|
||||
for c.NextBlock() {
|
||||
var f []string
|
||||
|
||||
@@ -82,6 +83,7 @@ func secondaryParse(c *caddy.Controller) (file.Zones, error) {
|
||||
if err != nil {
|
||||
return file.Zones{}, err
|
||||
}
|
||||
hasTransfer = true
|
||||
default:
|
||||
return file.Zones{}, c.Errf("unknown property '%s'", c.Val())
|
||||
}
|
||||
@@ -93,6 +95,9 @@ func secondaryParse(c *caddy.Controller) (file.Zones, error) {
|
||||
z[origin].Upstream = upstream.New()
|
||||
}
|
||||
}
|
||||
if !hasTransfer {
|
||||
return file.Zones{}, c.Err("secondary zones require a transfer from property")
|
||||
}
|
||||
}
|
||||
}
|
||||
return file.Zones{Z: z, Names: names}, nil
|
||||
|
||||
Reference in New Issue
Block a user