diff options
author | 2017-03-16 14:52:30 +0000 | |
---|---|---|
committer | 2017-03-16 14:52:30 +0000 | |
commit | 36c743a4d81cac1f8de8454c707c1ac7089bf783 (patch) | |
tree | cb5dc7ccd3262c867de6fbac3bd1860691340594 | |
parent | 5ac6020f45786d937ba754a61ed63f86ad4f7d0d (diff) | |
download | coredns-36c743a4d81cac1f8de8454c707c1ac7089bf783.tar.gz coredns-36c743a4d81cac1f8de8454c707c1ac7089bf783.tar.zst coredns-36c743a4d81cac1f8de8454c707c1ac7089bf783.zip |
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.
-rw-r--r-- | middleware/etcd/setup.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/middleware/etcd/setup.go b/middleware/etcd/setup.go index a6dca57c0..a193c745c 100644 --- a/middleware/etcd/setup.go +++ b/middleware/etcd/setup.go @@ -49,7 +49,8 @@ func setup(c *caddy.Controller) error { func etcdParse(c *caddy.Controller) (*Etcd, bool, error) { stub := make(map[string]proxy.Proxy) 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", Ctx: context.Background(), Inflight: &singleflight.Group{}, @@ -68,7 +69,10 @@ func etcdParse(c *caddy.Controller) (*Etcd, bool, error) { etc.Zones = make([]string, len(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() { // TODO(miek): 2 switches? switch c.Val() { |