Add TCP Healthcheck
This commit is contained in:
parent
d1ab6ed489
commit
8392503df7
37 changed files with 2416 additions and 307 deletions
|
|
@ -233,6 +233,49 @@ func TestManager_BuildTCP(t *testing.T) {
|
|||
providerName: "provider-1",
|
||||
expectedError: "no transport configuration found for \"myServersTransport@provider-1\"",
|
||||
},
|
||||
{
|
||||
desc: "WRR with healthcheck enabled",
|
||||
stConfigs: map[string]*dynamic.TCPServersTransport{"default@internal": {}},
|
||||
serviceName: "serviceName",
|
||||
configs: map[string]*runtime.TCPServiceInfo{
|
||||
"serviceName@provider-1": {
|
||||
TCPService: &dynamic.TCPService{
|
||||
Weighted: &dynamic.TCPWeightedRoundRobin{
|
||||
Services: []dynamic.TCPWRRService{
|
||||
{Name: "foobar@provider-1", Weight: new(int)},
|
||||
{Name: "foobar2@provider-1", Weight: new(int)},
|
||||
},
|
||||
HealthCheck: &dynamic.HealthCheck{},
|
||||
},
|
||||
},
|
||||
},
|
||||
"foobar@provider-1": {
|
||||
TCPService: &dynamic.TCPService{
|
||||
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Address: "192.168.0.12:80",
|
||||
},
|
||||
},
|
||||
HealthCheck: &dynamic.TCPServerHealthCheck{},
|
||||
},
|
||||
},
|
||||
},
|
||||
"foobar2@provider-1": {
|
||||
TCPService: &dynamic.TCPService{
|
||||
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Address: "192.168.0.13:80",
|
||||
},
|
||||
},
|
||||
HealthCheck: &dynamic.TCPServerHealthCheck{},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
providerName: "provider-1",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range testCases {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue