diff options
author | 2020-05-29 12:30:26 -0400 | |
---|---|---|
committer | 2020-05-29 18:30:26 +0200 | |
commit | 54fb2112ac7616db93d5b9e505079d821f15ec2d (patch) | |
tree | 25ad6561a7c42881e620db0e7bd2497fb562476d /plugin/grpc/grpc.go | |
parent | bc2ba28865248291f0a4492979f960eb00430ae2 (diff) | |
download | coredns-54fb2112ac7616db93d5b9e505079d821f15ec2d.tar.gz coredns-54fb2112ac7616db93d5b9e505079d821f15ec2d.tar.zst coredns-54fb2112ac7616db93d5b9e505079d821f15ec2d.zip |
plugin/forward/grpc: Revert forward/grpc policy dedup (#3919)
* revert de-dup
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* unit test
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
* use roundrobin policy in test
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin/grpc/grpc.go')
-rw-r--r-- | plugin/grpc/grpc.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/plugin/grpc/grpc.go b/plugin/grpc/grpc.go index 878b6c3f4..3dda225df 100644 --- a/plugin/grpc/grpc.go +++ b/plugin/grpc/grpc.go @@ -7,7 +7,6 @@ import ( "github.com/coredns/coredns/plugin" "github.com/coredns/coredns/plugin/debug" - "github.com/coredns/coredns/plugin/pkg/policy" "github.com/coredns/coredns/request" "github.com/miekg/dns" @@ -18,7 +17,7 @@ import ( // It has a list of proxies each representing one upstream proxy. type GRPC struct { proxies []*Proxy - p policy.Policy + p Policy from string ignored []string @@ -94,7 +93,7 @@ func (g *GRPC) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) ( // NewGRPC returns a new GRPC. func newGRPC() *GRPC { g := &GRPC{ - p: new(policy.Random), + p: new(random), } return g } @@ -127,11 +126,6 @@ func (g *GRPC) isAllowedDomain(name string) bool { } // List returns a set of proxies to be used for this client depending on the policy in p. -func (g *GRPC) list() []*Proxy { - if len(g.p.List(g.proxies)) == 1 { - return g.p.List(g.proxies)[0].([]*Proxy) - } - return nil -} +func (g *GRPC) list() []*Proxy { return g.p.List(g.proxies) } const defaultTimeout = 5 * time.Second |