mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
middleware/etc: normalize the zone correctly (#597)
Also don't default to a default proxy; keep it empty. Normalize the zones, so that is the server block ones are used, it will actually work.
This commit is contained in:
@@ -49,7 +49,8 @@ func setup(c *caddy.Controller) error {
|
|||||||
func etcdParse(c *caddy.Controller) (*Etcd, bool, error) {
|
func etcdParse(c *caddy.Controller) (*Etcd, bool, error) {
|
||||||
stub := make(map[string]proxy.Proxy)
|
stub := make(map[string]proxy.Proxy)
|
||||||
etc := Etcd{
|
etc := Etcd{
|
||||||
Proxy: proxy.NewLookup([]string{"8.8.8.8:53", "8.8.4.4:53"}),
|
// Don't default to a proxy for lookups.
|
||||||
|
// Proxy: proxy.NewLookup([]string{"8.8.8.8:53", "8.8.4.4:53"}),
|
||||||
PathPrefix: "skydns",
|
PathPrefix: "skydns",
|
||||||
Ctx: context.Background(),
|
Ctx: context.Background(),
|
||||||
Inflight: &singleflight.Group{},
|
Inflight: &singleflight.Group{},
|
||||||
@@ -68,7 +69,10 @@ func etcdParse(c *caddy.Controller) (*Etcd, bool, error) {
|
|||||||
etc.Zones = make([]string, len(c.ServerBlockKeys))
|
etc.Zones = make([]string, len(c.ServerBlockKeys))
|
||||||
copy(etc.Zones, c.ServerBlockKeys)
|
copy(etc.Zones, c.ServerBlockKeys)
|
||||||
}
|
}
|
||||||
middleware.Zones(etc.Zones).Normalize()
|
for i, str := range etc.Zones {
|
||||||
|
etc.Zones[i] = middleware.Host(str).Normalize()
|
||||||
|
}
|
||||||
|
|
||||||
if c.NextBlock() {
|
if c.NextBlock() {
|
||||||
// TODO(miek): 2 switches?
|
// TODO(miek): 2 switches?
|
||||||
switch c.Val() {
|
switch c.Val() {
|
||||||
|
|||||||
Reference in New Issue
Block a user