Merge tag 'v1.7.4' into master
This commit is contained in:
commit
d3ae88f108
154 changed files with 4356 additions and 1285 deletions
|
@ -21,14 +21,16 @@ import (
|
|||
func (p *Provider) buildConfiguration(instances []ecsInstance) (*types.Configuration, error) {
|
||||
var ecsFuncMap = template.FuncMap{
|
||||
// Backend functions
|
||||
"getHost": getHost,
|
||||
"getPort": getPort,
|
||||
"getCircuitBreaker": label.GetCircuitBreaker,
|
||||
"getLoadBalancer": label.GetLoadBalancer,
|
||||
"getMaxConn": label.GetMaxConn,
|
||||
"getHealthCheck": label.GetHealthCheck,
|
||||
"getBuffering": label.GetBuffering,
|
||||
"getServers": getServers,
|
||||
"getHost": getHost,
|
||||
"getPort": getPort,
|
||||
"getCircuitBreaker": label.GetCircuitBreaker,
|
||||
"getLoadBalancer": label.GetLoadBalancer,
|
||||
"getMaxConn": label.GetMaxConn,
|
||||
"getHealthCheck": label.GetHealthCheck,
|
||||
"getBuffering": label.GetBuffering,
|
||||
"getResponseForwarding": label.GetResponseForwarding,
|
||||
|
||||
"getServers": getServers,
|
||||
|
||||
// Frontend functions
|
||||
"filterFrontends": filterFrontends,
|
||||
|
@ -141,7 +143,11 @@ func (p *Provider) getFrontendRule(i ecsInstance) string {
|
|||
}
|
||||
|
||||
domain := label.GetStringValue(i.SegmentLabels, label.TraefikDomain, p.Domain)
|
||||
defaultRule := "Host:" + strings.ToLower(strings.Replace(i.Name, "_", "-", -1)) + "." + domain
|
||||
if len(domain) > 0 {
|
||||
domain = "." + domain
|
||||
}
|
||||
|
||||
defaultRule := "Host:" + strings.ToLower(strings.Replace(i.Name, "_", "-", -1)) + domain
|
||||
|
||||
return label.GetStringValue(i.TraefikLabels, label.TraefikFrontendRule, defaultRule)
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Backend: "backend-instance",
|
||||
Routes: map[string]types.Route{
|
||||
"route-frontend-instance": {
|
||||
Rule: "Host:instance.",
|
||||
Rule: "Host:instance",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
|
@ -101,7 +101,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Backend: "backend-instance",
|
||||
Routes: map[string]types.Route{
|
||||
"route-frontend-instance": {
|
||||
Rule: "Host:instance.",
|
||||
Rule: "Host:instance",
|
||||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
|
@ -146,7 +146,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Backend: "backend-instance",
|
||||
Routes: map[string]types.Route{
|
||||
"route-frontend-instance": {
|
||||
Rule: "Host:instance.",
|
||||
Rule: "Host:instance",
|
||||
},
|
||||
},
|
||||
Auth: &types.Auth{
|
||||
|
@ -197,7 +197,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Backend: "backend-instance",
|
||||
Routes: map[string]types.Route{
|
||||
"route-frontend-instance": {
|
||||
Rule: "Host:instance.",
|
||||
Rule: "Host:instance",
|
||||
},
|
||||
},
|
||||
Auth: &types.Auth{
|
||||
|
@ -248,7 +248,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Backend: "backend-instance",
|
||||
Routes: map[string]types.Route{
|
||||
"route-frontend-instance": {
|
||||
Rule: "Host:instance.",
|
||||
Rule: "Host:instance",
|
||||
},
|
||||
},
|
||||
Auth: &types.Auth{
|
||||
|
@ -307,7 +307,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
Backend: "backend-instance",
|
||||
Routes: map[string]types.Route{
|
||||
"route-frontend-instance": {
|
||||
Rule: "Host:instance.",
|
||||
Rule: "Host:instance",
|
||||
},
|
||||
},
|
||||
Auth: &types.Auth{
|
||||
|
@ -344,6 +344,7 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
label.TraefikBackend: aws.String("foobar"),
|
||||
|
||||
label.TraefikBackendCircuitBreakerExpression: aws.String("NetworkErrorRatio() > 0.5"),
|
||||
label.TraefikBackendResponseForwardingFlushInterval: aws.String("10ms"),
|
||||
label.TraefikBackendHealthCheckScheme: aws.String("http"),
|
||||
label.TraefikBackendHealthCheckPath: aws.String("/health"),
|
||||
label.TraefikBackendHealthCheckPort: aws.String("880"),
|
||||
|
@ -461,6 +462,9 @@ func TestBuildConfiguration(t *testing.T) {
|
|||
CircuitBreaker: &types.CircuitBreaker{
|
||||
Expression: "NetworkErrorRatio() > 0.5",
|
||||
},
|
||||
ResponseForwarding: &types.ResponseForwarding{
|
||||
FlushInterval: "10ms",
|
||||
},
|
||||
LoadBalancer: &types.LoadBalancer{
|
||||
Method: "drr",
|
||||
Stickiness: &types.Stickiness{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue