New static configuration loading system.
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
parent
d18edd6f77
commit
8d7eccad5d
165 changed files with 10894 additions and 6076 deletions
|
@ -5,7 +5,6 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/containous/flaeg/parse"
|
||||
"github.com/containous/traefik/pkg/config/static"
|
||||
"github.com/containous/traefik/pkg/ping"
|
||||
"github.com/containous/traefik/pkg/provider"
|
||||
|
@ -38,18 +37,18 @@ func TestDo_globalConfiguration(t *testing.T) {
|
|||
FilePath: "AccessLog FilePath",
|
||||
Format: "AccessLog Format",
|
||||
Filters: &types.AccessLogFilters{
|
||||
StatusCodes: types.StatusCodes{"200", "500"},
|
||||
StatusCodes: []string{"200", "500"},
|
||||
RetryAttempts: true,
|
||||
MinDuration: 10,
|
||||
},
|
||||
Fields: &types.AccessLogFields{
|
||||
DefaultMode: "drop",
|
||||
Names: types.FieldNames{
|
||||
Names: map[string]string{
|
||||
"RequestHost": "keep",
|
||||
},
|
||||
Headers: &types.FieldHeaders{
|
||||
DefaultMode: "drop",
|
||||
Names: types.FieldHeaderNames{
|
||||
Names: map[string]string{
|
||||
"Referer": "keep",
|
||||
},
|
||||
},
|
||||
|
@ -68,9 +67,9 @@ func TestDo_globalConfiguration(t *testing.T) {
|
|||
Address: "foo Address",
|
||||
Transport: &static.EntryPointsTransport{
|
||||
RespondingTimeouts: &static.RespondingTimeouts{
|
||||
ReadTimeout: parse.Duration(111 * time.Second),
|
||||
WriteTimeout: parse.Duration(111 * time.Second),
|
||||
IdleTimeout: parse.Duration(111 * time.Second),
|
||||
ReadTimeout: types.Duration(111 * time.Second),
|
||||
WriteTimeout: types.Duration(111 * time.Second),
|
||||
IdleTimeout: types.Duration(111 * time.Second),
|
||||
},
|
||||
},
|
||||
ProxyProtocol: &static.ProxyProtocol{
|
||||
|
@ -81,9 +80,9 @@ func TestDo_globalConfiguration(t *testing.T) {
|
|||
Address: "fii Address",
|
||||
Transport: &static.EntryPointsTransport{
|
||||
RespondingTimeouts: &static.RespondingTimeouts{
|
||||
ReadTimeout: parse.Duration(111 * time.Second),
|
||||
WriteTimeout: parse.Duration(111 * time.Second),
|
||||
IdleTimeout: parse.Duration(111 * time.Second),
|
||||
ReadTimeout: types.Duration(111 * time.Second),
|
||||
WriteTimeout: types.Duration(111 * time.Second),
|
||||
IdleTimeout: types.Duration(111 * time.Second),
|
||||
},
|
||||
},
|
||||
ProxyProtocol: &static.ProxyProtocol{
|
||||
|
@ -112,16 +111,16 @@ func TestDo_globalConfiguration(t *testing.T) {
|
|||
},
|
||||
}
|
||||
config.Providers = &static.Providers{
|
||||
ProvidersThrottleDuration: parse.Duration(111 * time.Second),
|
||||
ProvidersThrottleDuration: types.Duration(111 * time.Second),
|
||||
}
|
||||
|
||||
config.ServersTransport = &static.ServersTransport{
|
||||
InsecureSkipVerify: true,
|
||||
RootCAs: traefiktls.FilesOrContents{"RootCAs 1", "RootCAs 2", "RootCAs 3"},
|
||||
RootCAs: []traefiktls.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"},
|
||||
MaxIdleConnsPerHost: 111,
|
||||
ForwardingTimeouts: &static.ForwardingTimeouts{
|
||||
DialTimeout: parse.Duration(111 * time.Second),
|
||||
ResponseHeaderTimeout: parse.Duration(111 * time.Second),
|
||||
DialTimeout: types.Duration(111 * time.Second),
|
||||
ResponseHeaderTimeout: types.Duration(111 * time.Second),
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -156,15 +155,15 @@ func TestDo_globalConfiguration(t *testing.T) {
|
|||
|
||||
config.Providers.Docker = &docker.Provider{
|
||||
Constrainer: provider.Constrainer{
|
||||
Constraints: types.Constraints{
|
||||
Constraints: []*types.Constraint{
|
||||
{
|
||||
Key: "file Constraints Key 1",
|
||||
Regex: "file Constraints Regex 2",
|
||||
Value: "file Constraints Regex 2",
|
||||
MustMatch: true,
|
||||
},
|
||||
{
|
||||
Key: "file Constraints Key 1",
|
||||
Regex: "file Constraints Regex 2",
|
||||
Value: "file Constraints Regex 2",
|
||||
MustMatch: true,
|
||||
},
|
||||
},
|
||||
|
@ -210,22 +209,22 @@ func TestDo_globalConfiguration(t *testing.T) {
|
|||
|
||||
config.Metrics = &types.Metrics{
|
||||
Prometheus: &types.Prometheus{
|
||||
Buckets: types.Buckets{0.1, 0.3, 1.2, 5},
|
||||
Buckets: []float64{0.1, 0.3, 1.2, 5},
|
||||
EntryPoint: "MyEntryPoint",
|
||||
Middlewares: []string{"m1", "m2"},
|
||||
},
|
||||
Datadog: &types.Datadog{
|
||||
Address: "localhost:8181",
|
||||
PushInterval: "12",
|
||||
PushInterval: 12,
|
||||
},
|
||||
StatsD: &types.Statsd{
|
||||
Address: "localhost:8182",
|
||||
PushInterval: "42",
|
||||
PushInterval: 42,
|
||||
},
|
||||
InfluxDB: &types.InfluxDB{
|
||||
Address: "localhost:8183",
|
||||
Protocol: "http",
|
||||
PushInterval: "22",
|
||||
PushInterval: 22,
|
||||
Database: "myDB",
|
||||
RetentionPolicy: "12",
|
||||
Username: "a",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue