Use common TLS parsing routine for etcd (#476)

* Use common TLS parsing routine for etcd

Change to use the new common routine, and update the docs to reflect
the different options for passing TLS configuration.

* Move middleware/tls to middleware/pkg/tls

This was put in the wrong place originally.
This commit is contained in:
John Belamaric
2017-01-12 03:14:24 -05:00
committed by Miek Gieben
parent 94c59da577
commit 2e366459c5
5 changed files with 26 additions and 37 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/miekg/coredns/middleware/pkg/singleflight"
"github.com/miekg/coredns/middleware/proxy"
"github.com/miekg/coredns/middleware/test"
"github.com/miekg/coredns/middleware/pkg/tls"
etcdc "github.com/coreos/etcd/client"
"github.com/mholt/caddy"
@@ -28,7 +29,8 @@ func newEtcdMiddleware() *Etcd {
ctxt, _ = context.WithTimeout(context.Background(), etcdTimeout)
endpoints := []string{"http://localhost:2379"}
client, _ := newEtcdClient(endpoints, "", "", "")
tlsc, _ := tls.NewTLSConfigFromArgs()
client, _ := newEtcdClient(endpoints, tlsc)
return &Etcd{
Proxy: proxy.New([]string{"8.8.8.8:53"}),