middleware/etcd: Use the correct endpoint

The endpoint for etcd as wrongly set if a proxy was configured.
Clean up some documentation in the process as well.
This commit is contained in:
Miek Gieben 2016-04-19 12:52:05 +00:00
parent 913cffd4a8
commit a1e6cb7cf4
9 changed files with 8 additions and 24 deletions

View file

@ -17,7 +17,7 @@ import (
"golang.org/x/net/context"
)
const defaultEndpoint = "http://127.0.0.1:2379"
const defaultEndpoint = "http://localhost:2379"
// Etcd sets up the etcd middleware.
func Etcd(c *Controller) (middleware.Middleware, error) {
@ -125,7 +125,6 @@ func etcdParse(c *Controller) (etcd.Etcd, bool, error) {
args[i] = h + ":53"
}
}
endpoints = args
etc.Proxy = proxy.New(args)
case "tls": // cert key cacertfile
args := c.RemainingArgs()

View file

@ -15,7 +15,7 @@ etcd [zones...]
* `zones` zones etcd should be authoritative for.
The path will default to `/skydns` the local etcd proxy (http://127.0.0.1:2379).
The path will default to `/skydns` the local etcd proxy (http://localhost:2379).
If no zones are specified the block's zone will be used as the zone.
If you want to `round robin` A and AAAA responses look at the `loadbalance` middleware.
@ -45,12 +45,14 @@ This is the default SkyDNS setup, with everying specified in full:
~~~
.:53 {
etcd {
etcd skydns.local {
stubzones
path /skydns
endpoint http://localhost:2397
endpoint http://localhost:2379
upstream 8.8.8.8:53 8.8.4.4:53
}
prometheus
cache 160 skydns.local
loadbalance
proxy . 8.8.8.8:53 8.8.4.4:53
}

View file

@ -2,7 +2,7 @@
package etcd
// etcd needs to be running on http://127.0.0.1:2379
// etcd needs to be running on http://localhost:2379
import (
"testing"

View file

@ -2,10 +2,6 @@
package etcd
// etcd needs to be running on http://127.0.0.1:2379
// *and* needs connectivity to the internet for remotely resolving
// names.
import (
"sort"
"testing"

View file

@ -73,6 +73,7 @@ func (e Etcd) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
return e.Err(zone, dns.RcodeNameError, state)
}
if err != nil {
println("returning error", err.Error())
return dns.RcodeServerFailure, err
}

View file

@ -2,10 +2,6 @@
package etcd
// etcd needs to be running on http://127.0.0.1:2379
// *and* needs connectivity to the internet for remotely resolving
// names.
import (
"github.com/miekg/coredns/middleware/etcd/msg"
"github.com/miekg/coredns/middleware/test"

View file

@ -2,9 +2,6 @@
package etcd
// etcd needs to be running on http://127.0.0.1:2379
// *and* needs connectivity to the internet for remotely resolving names.
import (
"sort"
"testing"

View file

@ -4,10 +4,6 @@
package etcd
// etcd needs to be running on http://127.0.0.1:2379
// *and* needs connectivity to the internet for remotely resolving
// names.
import (
"sort"
"testing"

View file

@ -2,9 +2,6 @@
package etcd
// etcd needs to be running on http://127.0.0.1:2379
// *and* needs connectivity to the internet for remotely resolving names.
import (
"encoding/json"
"sort"