1
0
Fork 0

Add flush interval option on backend

This commit is contained in:
SALLEYRON Julien 2018-10-29 18:42:03 +01:00 committed by Traefiker Bot
parent c6dd1dccc3
commit e6e9a86919
43 changed files with 420 additions and 85 deletions

View file

@ -33,13 +33,14 @@ func (p *Provider) buildConfigurationV2(containersInspected []dockerData) *types
"getDomain": label.GetFuncString(label.TraefikDomain, p.Domain),
// Backend functions
"getIPAddress": p.getDeprecatedIPAddress, // TODO: Should we expose getIPPort instead?
"getServers": p.getServers,
"getMaxConn": label.GetMaxConn,
"getHealthCheck": label.GetHealthCheck,
"getBuffering": label.GetBuffering,
"getCircuitBreaker": label.GetCircuitBreaker,
"getLoadBalancer": label.GetLoadBalancer,
"getIPAddress": p.getDeprecatedIPAddress, // TODO: Should we expose getIPPort instead?
"getServers": p.getServers,
"getMaxConn": label.GetMaxConn,
"getHealthCheck": label.GetHealthCheck,
"getBuffering": label.GetBuffering,
"getResponseForwarding": label.GetResponseForwarding,
"getCircuitBreaker": label.GetCircuitBreaker,
"getLoadBalancer": label.GetLoadBalancer,
// Frontend functions
"getBackendName": getBackendName,

View file

@ -434,6 +434,7 @@ func TestDockerBuildConfiguration(t *testing.T) {
label.TraefikBackend: "foobar",
label.TraefikBackendCircuitBreakerExpression: "NetworkErrorRatio() > 0.5",
label.TraefikBackendResponseForwardingFlushInterval: "10ms",
label.TraefikBackendHealthCheckScheme: "http",
label.TraefikBackendHealthCheckPath: "/health",
label.TraefikBackendHealthCheckPort: "880",
@ -666,6 +667,9 @@ func TestDockerBuildConfiguration(t *testing.T) {
CircuitBreaker: &types.CircuitBreaker{
Expression: "NetworkErrorRatio() > 0.5",
},
ResponseForwarding: &types.ResponseForwarding{
FlushInterval: "10ms",
},
LoadBalancer: &types.LoadBalancer{
Method: "drr",
Sticky: true,

View file

@ -383,6 +383,7 @@ func TestSwarmBuildConfiguration(t *testing.T) {
label.TraefikBackend: "foobar",
label.TraefikBackendCircuitBreakerExpression: "NetworkErrorRatio() > 0.5",
label.TraefikBackendResponseForwardingFlushInterval: "10ms",
label.TraefikBackendHealthCheckScheme: "http",
label.TraefikBackendHealthCheckPath: "/health",
label.TraefikBackendHealthCheckPort: "880",
@ -584,6 +585,9 @@ func TestSwarmBuildConfiguration(t *testing.T) {
CircuitBreaker: &types.CircuitBreaker{
Expression: "NetworkErrorRatio() > 0.5",
},
ResponseForwarding: &types.ResponseForwarding{
FlushInterval: "10ms",
},
LoadBalancer: &types.LoadBalancer{
Method: "drr",
Sticky: true,