Move dynamic config into a dedicated package.
This commit is contained in:
parent
09cc1161c9
commit
c8bf8e896a
102 changed files with 3170 additions and 3166 deletions
|
@ -5,7 +5,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/containous/traefik/pkg/config"
|
||||
"github.com/containous/traefik/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/pkg/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -175,9 +175,9 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
configuration, err := DecodeConfiguration(labels)
|
||||
require.NoError(t, err)
|
||||
|
||||
expected := &config.Configuration{
|
||||
TCP: &config.TCPConfiguration{
|
||||
Routers: map[string]*config.TCPRouter{
|
||||
expected := &dynamic.Configuration{
|
||||
TCP: &dynamic.TCPConfiguration{
|
||||
Routers: map[string]*dynamic.TCPRouter{
|
||||
"Router0": {
|
||||
EntryPoints: []string{
|
||||
"foobar",
|
||||
|
@ -185,7 +185,7 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
Service: "foobar",
|
||||
Rule: "foobar",
|
||||
TLS: &config.RouterTCPTLSConfig{
|
||||
TLS: &dynamic.RouterTCPTLSConfig{
|
||||
Passthrough: false,
|
||||
Options: "foo",
|
||||
},
|
||||
|
@ -197,16 +197,16 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
Service: "foobar",
|
||||
Rule: "foobar",
|
||||
TLS: &config.RouterTCPTLSConfig{
|
||||
TLS: &dynamic.RouterTCPTLSConfig{
|
||||
Passthrough: false,
|
||||
Options: "foo",
|
||||
},
|
||||
},
|
||||
},
|
||||
Services: map[string]*config.TCPService{
|
||||
Services: map[string]*dynamic.TCPService{
|
||||
"Service0": {
|
||||
LoadBalancer: &config.TCPLoadBalancerService{
|
||||
Servers: []config.TCPServer{
|
||||
LoadBalancer: &dynamic.TCPLoadBalancerService{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Port: "42",
|
||||
},
|
||||
|
@ -214,8 +214,8 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Service1": {
|
||||
LoadBalancer: &config.TCPLoadBalancerService{
|
||||
Servers: []config.TCPServer{
|
||||
LoadBalancer: &dynamic.TCPLoadBalancerService{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Port: "42",
|
||||
},
|
||||
|
@ -224,8 +224,8 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
HTTP: &config.HTTPConfiguration{
|
||||
Routers: map[string]*config.Router{
|
||||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Routers: map[string]*dynamic.Router{
|
||||
"Router0": {
|
||||
EntryPoints: []string{
|
||||
"foobar",
|
||||
|
@ -238,7 +238,7 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
Service: "foobar",
|
||||
Rule: "foobar",
|
||||
Priority: 42,
|
||||
TLS: &config.RouterTLSConfig{},
|
||||
TLS: &dynamic.RouterTLSConfig{},
|
||||
},
|
||||
"Router1": {
|
||||
EntryPoints: []string{
|
||||
|
@ -254,14 +254,14 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
Priority: 42,
|
||||
},
|
||||
},
|
||||
Middlewares: map[string]*config.Middleware{
|
||||
Middlewares: map[string]*dynamic.Middleware{
|
||||
"Middleware0": {
|
||||
AddPrefix: &config.AddPrefix{
|
||||
AddPrefix: &dynamic.AddPrefix{
|
||||
Prefix: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware1": {
|
||||
BasicAuth: &config.BasicAuth{
|
||||
BasicAuth: &dynamic.BasicAuth{
|
||||
Users: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -273,18 +273,18 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware10": {
|
||||
MaxConn: &config.MaxConn{
|
||||
MaxConn: &dynamic.MaxConn{
|
||||
Amount: 42,
|
||||
ExtractorFunc: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware11": {
|
||||
PassTLSClientCert: &config.PassTLSClientCert{
|
||||
PassTLSClientCert: &dynamic.PassTLSClientCert{
|
||||
PEM: true,
|
||||
Info: &config.TLSClientCertificateInfo{
|
||||
Info: &dynamic.TLSClientCertificateInfo{
|
||||
NotAfter: true,
|
||||
NotBefore: true,
|
||||
Subject: &config.TLSCLientCertificateDNInfo{
|
||||
Subject: &dynamic.TLSCLientCertificateDNInfo{
|
||||
Country: true,
|
||||
Province: true,
|
||||
Locality: true,
|
||||
|
@ -293,7 +293,7 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
SerialNumber: true,
|
||||
DomainComponent: true,
|
||||
},
|
||||
Issuer: &config.TLSCLientCertificateDNInfo{
|
||||
Issuer: &dynamic.TLSCLientCertificateDNInfo{
|
||||
Country: true,
|
||||
Province: true,
|
||||
Locality: true,
|
||||
|
@ -307,8 +307,8 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware12": {
|
||||
RateLimit: &config.RateLimit{
|
||||
RateSet: map[string]*config.Rate{
|
||||
RateLimit: &dynamic.RateLimit{
|
||||
RateSet: map[string]*dynamic.Rate{
|
||||
"Rate0": {
|
||||
Period: types.Duration(42 * time.Second),
|
||||
Average: 42,
|
||||
|
@ -324,37 +324,37 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware13": {
|
||||
RedirectRegex: &config.RedirectRegex{
|
||||
RedirectRegex: &dynamic.RedirectRegex{
|
||||
Regex: "foobar",
|
||||
Replacement: "foobar",
|
||||
Permanent: true,
|
||||
},
|
||||
},
|
||||
"Middleware13b": {
|
||||
RedirectScheme: &config.RedirectScheme{
|
||||
RedirectScheme: &dynamic.RedirectScheme{
|
||||
Scheme: "https",
|
||||
Port: "80",
|
||||
Permanent: true,
|
||||
},
|
||||
},
|
||||
"Middleware14": {
|
||||
ReplacePath: &config.ReplacePath{
|
||||
ReplacePath: &dynamic.ReplacePath{
|
||||
Path: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware15": {
|
||||
ReplacePathRegex: &config.ReplacePathRegex{
|
||||
ReplacePathRegex: &dynamic.ReplacePathRegex{
|
||||
Regex: "foobar",
|
||||
Replacement: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware16": {
|
||||
Retry: &config.Retry{
|
||||
Retry: &dynamic.Retry{
|
||||
Attempts: 42,
|
||||
},
|
||||
},
|
||||
"Middleware17": {
|
||||
StripPrefix: &config.StripPrefix{
|
||||
StripPrefix: &dynamic.StripPrefix{
|
||||
Prefixes: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -362,7 +362,7 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware18": {
|
||||
StripPrefixRegex: &config.StripPrefixRegex{
|
||||
StripPrefixRegex: &dynamic.StripPrefixRegex{
|
||||
Regex: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -370,10 +370,10 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware19": {
|
||||
Compress: &config.Compress{},
|
||||
Compress: &dynamic.Compress{},
|
||||
},
|
||||
"Middleware2": {
|
||||
Buffering: &config.Buffering{
|
||||
Buffering: &dynamic.Buffering{
|
||||
MaxRequestBodyBytes: 42,
|
||||
MemRequestBodyBytes: 42,
|
||||
MaxResponseBodyBytes: 42,
|
||||
|
@ -382,7 +382,7 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware3": {
|
||||
Chain: &config.Chain{
|
||||
Chain: &dynamic.Chain{
|
||||
Middlewares: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -390,12 +390,12 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware4": {
|
||||
CircuitBreaker: &config.CircuitBreaker{
|
||||
CircuitBreaker: &dynamic.CircuitBreaker{
|
||||
Expression: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware5": {
|
||||
DigestAuth: &config.DigestAuth{
|
||||
DigestAuth: &dynamic.DigestAuth{
|
||||
Users: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -407,7 +407,7 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware6": {
|
||||
Errors: &config.ErrorPage{
|
||||
Errors: &dynamic.ErrorPage{
|
||||
Status: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -417,9 +417,9 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware7": {
|
||||
ForwardAuth: &config.ForwardAuth{
|
||||
ForwardAuth: &dynamic.ForwardAuth{
|
||||
Address: "foobar",
|
||||
TLS: &config.ClientTLS{
|
||||
TLS: &dynamic.ClientTLS{
|
||||
CA: "foobar",
|
||||
CAOptional: true,
|
||||
Cert: "foobar",
|
||||
|
@ -434,7 +434,7 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware8": {
|
||||
Headers: &config.Headers{
|
||||
Headers: &dynamic.Headers{
|
||||
CustomRequestHeaders: map[string]string{
|
||||
"name0": "foobar",
|
||||
"name1": "foobar",
|
||||
|
@ -491,12 +491,12 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware9": {
|
||||
IPWhiteList: &config.IPWhiteList{
|
||||
IPWhiteList: &dynamic.IPWhiteList{
|
||||
SourceRange: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
},
|
||||
IPStrategy: &config.IPStrategy{
|
||||
IPStrategy: &dynamic.IPStrategy{
|
||||
Depth: 42,
|
||||
ExcludedIPs: []string{
|
||||
"foobar",
|
||||
|
@ -506,21 +506,21 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
Services: map[string]*config.Service{
|
||||
Services: map[string]*dynamic.Service{
|
||||
"Service0": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Stickiness: &config.Stickiness{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Stickiness: &dynamic.Stickiness{
|
||||
CookieName: "foobar",
|
||||
SecureCookie: true,
|
||||
HTTPOnlyCookie: false,
|
||||
},
|
||||
Servers: []config.Server{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
Scheme: "foobar",
|
||||
Port: "8080",
|
||||
},
|
||||
},
|
||||
HealthCheck: &config.HealthCheck{
|
||||
HealthCheck: &dynamic.HealthCheck{
|
||||
Scheme: "foobar",
|
||||
Path: "foobar",
|
||||
Port: 42,
|
||||
|
@ -533,20 +533,20 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
ResponseForwarding: &config.ResponseForwarding{
|
||||
ResponseForwarding: &dynamic.ResponseForwarding{
|
||||
FlushInterval: "foobar",
|
||||
},
|
||||
},
|
||||
},
|
||||
"Service1": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
Scheme: "foobar",
|
||||
Port: "8080",
|
||||
},
|
||||
},
|
||||
HealthCheck: &config.HealthCheck{
|
||||
HealthCheck: &dynamic.HealthCheck{
|
||||
Scheme: "foobar",
|
||||
Path: "foobar",
|
||||
Port: 42,
|
||||
|
@ -559,7 +559,7 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
ResponseForwarding: &config.ResponseForwarding{
|
||||
ResponseForwarding: &dynamic.ResponseForwarding{
|
||||
FlushInterval: "foobar",
|
||||
},
|
||||
},
|
||||
|
@ -572,9 +572,9 @@ func TestDecodeConfiguration(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestEncodeConfiguration(t *testing.T) {
|
||||
configuration := &config.Configuration{
|
||||
TCP: &config.TCPConfiguration{
|
||||
Routers: map[string]*config.TCPRouter{
|
||||
configuration := &dynamic.Configuration{
|
||||
TCP: &dynamic.TCPConfiguration{
|
||||
Routers: map[string]*dynamic.TCPRouter{
|
||||
"Router0": {
|
||||
EntryPoints: []string{
|
||||
"foobar",
|
||||
|
@ -582,7 +582,7 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
Service: "foobar",
|
||||
Rule: "foobar",
|
||||
TLS: &config.RouterTCPTLSConfig{
|
||||
TLS: &dynamic.RouterTCPTLSConfig{
|
||||
Passthrough: false,
|
||||
Options: "foo",
|
||||
},
|
||||
|
@ -594,16 +594,16 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
Service: "foobar",
|
||||
Rule: "foobar",
|
||||
TLS: &config.RouterTCPTLSConfig{
|
||||
TLS: &dynamic.RouterTCPTLSConfig{
|
||||
Passthrough: false,
|
||||
Options: "foo",
|
||||
},
|
||||
},
|
||||
},
|
||||
Services: map[string]*config.TCPService{
|
||||
Services: map[string]*dynamic.TCPService{
|
||||
"Service0": {
|
||||
LoadBalancer: &config.TCPLoadBalancerService{
|
||||
Servers: []config.TCPServer{
|
||||
LoadBalancer: &dynamic.TCPLoadBalancerService{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Port: "42",
|
||||
},
|
||||
|
@ -611,8 +611,8 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Service1": {
|
||||
LoadBalancer: &config.TCPLoadBalancerService{
|
||||
Servers: []config.TCPServer{
|
||||
LoadBalancer: &dynamic.TCPLoadBalancerService{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Port: "42",
|
||||
},
|
||||
|
@ -621,8 +621,8 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
HTTP: &config.HTTPConfiguration{
|
||||
Routers: map[string]*config.Router{
|
||||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Routers: map[string]*dynamic.Router{
|
||||
"Router0": {
|
||||
EntryPoints: []string{
|
||||
"foobar",
|
||||
|
@ -635,7 +635,7 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
Service: "foobar",
|
||||
Rule: "foobar",
|
||||
Priority: 42,
|
||||
TLS: &config.RouterTLSConfig{},
|
||||
TLS: &dynamic.RouterTLSConfig{},
|
||||
},
|
||||
"Router1": {
|
||||
EntryPoints: []string{
|
||||
|
@ -651,14 +651,14 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
Priority: 42,
|
||||
},
|
||||
},
|
||||
Middlewares: map[string]*config.Middleware{
|
||||
Middlewares: map[string]*dynamic.Middleware{
|
||||
"Middleware0": {
|
||||
AddPrefix: &config.AddPrefix{
|
||||
AddPrefix: &dynamic.AddPrefix{
|
||||
Prefix: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware1": {
|
||||
BasicAuth: &config.BasicAuth{
|
||||
BasicAuth: &dynamic.BasicAuth{
|
||||
Users: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -670,18 +670,18 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware10": {
|
||||
MaxConn: &config.MaxConn{
|
||||
MaxConn: &dynamic.MaxConn{
|
||||
Amount: 42,
|
||||
ExtractorFunc: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware11": {
|
||||
PassTLSClientCert: &config.PassTLSClientCert{
|
||||
PassTLSClientCert: &dynamic.PassTLSClientCert{
|
||||
PEM: true,
|
||||
Info: &config.TLSClientCertificateInfo{
|
||||
Info: &dynamic.TLSClientCertificateInfo{
|
||||
NotAfter: true,
|
||||
NotBefore: true,
|
||||
Subject: &config.TLSCLientCertificateDNInfo{
|
||||
Subject: &dynamic.TLSCLientCertificateDNInfo{
|
||||
Country: true,
|
||||
Province: true,
|
||||
Locality: true,
|
||||
|
@ -690,7 +690,7 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
SerialNumber: true,
|
||||
DomainComponent: true,
|
||||
},
|
||||
Issuer: &config.TLSCLientCertificateDNInfo{
|
||||
Issuer: &dynamic.TLSCLientCertificateDNInfo{
|
||||
Country: true,
|
||||
Province: true,
|
||||
Locality: true,
|
||||
|
@ -703,8 +703,8 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware12": {
|
||||
RateLimit: &config.RateLimit{
|
||||
RateSet: map[string]*config.Rate{
|
||||
RateLimit: &dynamic.RateLimit{
|
||||
RateSet: map[string]*dynamic.Rate{
|
||||
"Rate0": {
|
||||
Period: types.Duration(42 * time.Nanosecond),
|
||||
Average: 42,
|
||||
|
@ -720,37 +720,37 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware13": {
|
||||
RedirectRegex: &config.RedirectRegex{
|
||||
RedirectRegex: &dynamic.RedirectRegex{
|
||||
Regex: "foobar",
|
||||
Replacement: "foobar",
|
||||
Permanent: true,
|
||||
},
|
||||
},
|
||||
"Middleware13b": {
|
||||
RedirectScheme: &config.RedirectScheme{
|
||||
RedirectScheme: &dynamic.RedirectScheme{
|
||||
Scheme: "https",
|
||||
Port: "80",
|
||||
Permanent: true,
|
||||
},
|
||||
},
|
||||
"Middleware14": {
|
||||
ReplacePath: &config.ReplacePath{
|
||||
ReplacePath: &dynamic.ReplacePath{
|
||||
Path: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware15": {
|
||||
ReplacePathRegex: &config.ReplacePathRegex{
|
||||
ReplacePathRegex: &dynamic.ReplacePathRegex{
|
||||
Regex: "foobar",
|
||||
Replacement: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware16": {
|
||||
Retry: &config.Retry{
|
||||
Retry: &dynamic.Retry{
|
||||
Attempts: 42,
|
||||
},
|
||||
},
|
||||
"Middleware17": {
|
||||
StripPrefix: &config.StripPrefix{
|
||||
StripPrefix: &dynamic.StripPrefix{
|
||||
Prefixes: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -758,7 +758,7 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware18": {
|
||||
StripPrefixRegex: &config.StripPrefixRegex{
|
||||
StripPrefixRegex: &dynamic.StripPrefixRegex{
|
||||
Regex: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -766,10 +766,10 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware19": {
|
||||
Compress: &config.Compress{},
|
||||
Compress: &dynamic.Compress{},
|
||||
},
|
||||
"Middleware2": {
|
||||
Buffering: &config.Buffering{
|
||||
Buffering: &dynamic.Buffering{
|
||||
MaxRequestBodyBytes: 42,
|
||||
MemRequestBodyBytes: 42,
|
||||
MaxResponseBodyBytes: 42,
|
||||
|
@ -778,7 +778,7 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware3": {
|
||||
Chain: &config.Chain{
|
||||
Chain: &dynamic.Chain{
|
||||
Middlewares: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -786,12 +786,12 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware4": {
|
||||
CircuitBreaker: &config.CircuitBreaker{
|
||||
CircuitBreaker: &dynamic.CircuitBreaker{
|
||||
Expression: "foobar",
|
||||
},
|
||||
},
|
||||
"Middleware5": {
|
||||
DigestAuth: &config.DigestAuth{
|
||||
DigestAuth: &dynamic.DigestAuth{
|
||||
Users: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -803,7 +803,7 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware6": {
|
||||
Errors: &config.ErrorPage{
|
||||
Errors: &dynamic.ErrorPage{
|
||||
Status: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
|
@ -813,9 +813,9 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware7": {
|
||||
ForwardAuth: &config.ForwardAuth{
|
||||
ForwardAuth: &dynamic.ForwardAuth{
|
||||
Address: "foobar",
|
||||
TLS: &config.ClientTLS{
|
||||
TLS: &dynamic.ClientTLS{
|
||||
CA: "foobar",
|
||||
CAOptional: true,
|
||||
Cert: "foobar",
|
||||
|
@ -830,7 +830,7 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware8": {
|
||||
Headers: &config.Headers{
|
||||
Headers: &dynamic.Headers{
|
||||
CustomRequestHeaders: map[string]string{
|
||||
"name0": "foobar",
|
||||
"name1": "foobar",
|
||||
|
@ -887,12 +887,12 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
"Middleware9": {
|
||||
IPWhiteList: &config.IPWhiteList{
|
||||
IPWhiteList: &dynamic.IPWhiteList{
|
||||
SourceRange: []string{
|
||||
"foobar",
|
||||
"fiibar",
|
||||
},
|
||||
IPStrategy: &config.IPStrategy{
|
||||
IPStrategy: &dynamic.IPStrategy{
|
||||
Depth: 42,
|
||||
ExcludedIPs: []string{
|
||||
"foobar",
|
||||
|
@ -902,20 +902,20 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
Services: map[string]*config.Service{
|
||||
Services: map[string]*dynamic.Service{
|
||||
"Service0": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Stickiness: &config.Stickiness{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Stickiness: &dynamic.Stickiness{
|
||||
CookieName: "foobar",
|
||||
HTTPOnlyCookie: true,
|
||||
},
|
||||
Servers: []config.Server{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
Scheme: "foobar",
|
||||
Port: "8080",
|
||||
},
|
||||
},
|
||||
HealthCheck: &config.HealthCheck{
|
||||
HealthCheck: &dynamic.HealthCheck{
|
||||
Scheme: "foobar",
|
||||
Path: "foobar",
|
||||
Port: 42,
|
||||
|
@ -928,20 +928,20 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
ResponseForwarding: &config.ResponseForwarding{
|
||||
ResponseForwarding: &dynamic.ResponseForwarding{
|
||||
FlushInterval: "foobar",
|
||||
},
|
||||
},
|
||||
},
|
||||
"Service1": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
Scheme: "foobar",
|
||||
Port: "8080",
|
||||
},
|
||||
},
|
||||
HealthCheck: &config.HealthCheck{
|
||||
HealthCheck: &dynamic.HealthCheck{
|
||||
Scheme: "foobar",
|
||||
Path: "foobar",
|
||||
Port: 42,
|
||||
|
@ -954,7 +954,7 @@ func TestEncodeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
PassHostHeader: true,
|
||||
ResponseForwarding: &config.ResponseForwarding{
|
||||
ResponseForwarding: &dynamic.ResponseForwarding{
|
||||
FlushInterval: "foobar",
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue