mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
plugin/kubernetes: Allow only one k8s section (#1497)
* allow only one k8s section * add test
This commit is contained in:
committed by
Miek Gieben
parent
f636930c5c
commit
82854bf098
@@ -74,7 +74,10 @@ func kubernetesParse(c *caddy.Controller) (*Kubernetes, dnsControlOpts, error) {
|
||||
resyncPeriod: defaultResyncPeriod,
|
||||
}
|
||||
|
||||
for c.Next() {
|
||||
for i := 1; c.Next(); i++ {
|
||||
if i > 1 {
|
||||
return nil, opts, fmt.Errorf("only one kubernetes section allowed per server block")
|
||||
}
|
||||
zones := c.RemainingArgs()
|
||||
|
||||
if len(zones) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user