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>
This commit is contained in:
Chris O'Haver 2020-05-29 12:30:26 -04:00 committed by GitHub
parent bc2ba28865
commit 54fb2112ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 166 additions and 104 deletions

View file

@ -10,7 +10,6 @@ import (
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/metrics"
"github.com/coredns/coredns/plugin/pkg/parse"
"github.com/coredns/coredns/plugin/pkg/policy"
pkgtls "github.com/coredns/coredns/plugin/pkg/tls"
"github.com/coredns/coredns/plugin/pkg/transport"
@ -221,11 +220,11 @@ func parseBlock(c *caddy.Controller, f *Forward) error {
}
switch x := c.Val(); x {
case "random":
f.p = &policy.Random{}
f.p = &random{}
case "round_robin":
f.p = &policy.RoundRobin{}
f.p = &roundRobin{}
case "sequential":
f.p = &policy.Sequential{}
f.p = &sequential{}
default:
return c.Errf("unknown policy '%s'", x)
}