Move Healthcheck to middleware/pkg/healthcheck (#854)
* Move healthcheck out Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Move healthcheck to middleware/pkg/healthcheck Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
57692bbccf
commit
a1b175ef78
9 changed files with 359 additions and 348 deletions
|
@ -4,11 +4,13 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/coredns/coredns/middleware/pkg/healthcheck"
|
||||
|
||||
"google.golang.org/grpc/grpclog"
|
||||
)
|
||||
|
||||
func pool() []*UpstreamHost {
|
||||
return []*UpstreamHost{
|
||||
func pool() []*healthcheck.UpstreamHost {
|
||||
return []*healthcheck.UpstreamHost{
|
||||
{
|
||||
Name: "localhost:10053",
|
||||
},
|
||||
|
@ -22,13 +24,13 @@ func TestStartupShutdown(t *testing.T) {
|
|||
grpclog.SetLogger(discard{})
|
||||
|
||||
upstream := &staticUpstream{
|
||||
from: ".",
|
||||
Hosts: pool(),
|
||||
Policy: &Random{},
|
||||
Spray: nil,
|
||||
FailTimeout: 10 * time.Second,
|
||||
Future: 60 * time.Second,
|
||||
MaxFails: 1,
|
||||
from: ".",
|
||||
HealthCheck: healthcheck.HealthCheck{
|
||||
Hosts: pool(),
|
||||
FailTimeout: 10 * time.Second,
|
||||
Future: 60 * time.Second,
|
||||
MaxFails: 1,
|
||||
},
|
||||
}
|
||||
g := newGrpcClient(nil, upstream)
|
||||
upstream.ex = g
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue