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
|
@ -6,7 +6,7 @@ import (
|
|||
"github.com/containous/alice"
|
||||
"github.com/containous/mux"
|
||||
"github.com/containous/traefik/pkg/api"
|
||||
"github.com/containous/traefik/pkg/config"
|
||||
"github.com/containous/traefik/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/pkg/config/static"
|
||||
"github.com/containous/traefik/pkg/log"
|
||||
"github.com/containous/traefik/pkg/metrics"
|
||||
|
@ -20,7 +20,7 @@ type chainBuilder interface {
|
|||
|
||||
// NewRouteAppenderAggregator Creates a new RouteAppenderAggregator
|
||||
func NewRouteAppenderAggregator(ctx context.Context, chainBuilder chainBuilder, conf static.Configuration,
|
||||
entryPointName string, runtimeConfiguration *config.RuntimeConfiguration) *RouteAppenderAggregator {
|
||||
entryPointName string, runtimeConfiguration *dynamic.RuntimeConfiguration) *RouteAppenderAggregator {
|
||||
aggregator := &RouteAppenderAggregator{}
|
||||
|
||||
if conf.Providers != nil && conf.Providers.Rest != nil {
|
||||
|
|
|
@ -3,7 +3,7 @@ package router
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/containous/traefik/pkg/config"
|
||||
"github.com/containous/traefik/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/pkg/config/static"
|
||||
"github.com/containous/traefik/pkg/provider/acme"
|
||||
"github.com/containous/traefik/pkg/server/middleware"
|
||||
|
@ -27,7 +27,7 @@ type RouteAppenderFactory struct {
|
|||
}
|
||||
|
||||
// NewAppender Creates a new RouteAppender
|
||||
func (r *RouteAppenderFactory) NewAppender(ctx context.Context, middlewaresBuilder *middleware.Builder, runtimeConfiguration *config.RuntimeConfiguration) types.RouteAppender {
|
||||
func (r *RouteAppenderFactory) NewAppender(ctx context.Context, middlewaresBuilder *middleware.Builder, runtimeConfiguration *dynamic.RuntimeConfiguration) types.RouteAppender {
|
||||
aggregator := NewRouteAppenderAggregator(ctx, middlewaresBuilder, r.staticConfiguration, r.entryPointName, runtimeConfiguration)
|
||||
|
||||
if r.acmeProvider != nil && r.acmeProvider.HTTPChallenge != nil && r.acmeProvider.HTTPChallenge.EntryPoint == r.entryPointName {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/containous/alice"
|
||||
"github.com/containous/traefik/pkg/config"
|
||||
"github.com/containous/traefik/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/pkg/log"
|
||||
"github.com/containous/traefik/pkg/middlewares/accesslog"
|
||||
"github.com/containous/traefik/pkg/middlewares/recovery"
|
||||
|
@ -22,7 +22,7 @@ const (
|
|||
)
|
||||
|
||||
// NewManager Creates a new Manager
|
||||
func NewManager(conf *config.RuntimeConfiguration,
|
||||
func NewManager(conf *dynamic.RuntimeConfiguration,
|
||||
serviceManager *service.Manager,
|
||||
middlewaresBuilder *middleware.Builder,
|
||||
modifierBuilder *responsemodifiers.Builder,
|
||||
|
@ -42,15 +42,15 @@ type Manager struct {
|
|||
serviceManager *service.Manager
|
||||
middlewaresBuilder *middleware.Builder
|
||||
modifierBuilder *responsemodifiers.Builder
|
||||
conf *config.RuntimeConfiguration
|
||||
conf *dynamic.RuntimeConfiguration
|
||||
}
|
||||
|
||||
func (m *Manager) getHTTPRouters(ctx context.Context, entryPoints []string, tls bool) map[string]map[string]*config.RouterInfo {
|
||||
func (m *Manager) getHTTPRouters(ctx context.Context, entryPoints []string, tls bool) map[string]map[string]*dynamic.RouterInfo {
|
||||
if m.conf != nil {
|
||||
return m.conf.GetRoutersByEntrypoints(ctx, entryPoints, tls)
|
||||
}
|
||||
|
||||
return make(map[string]map[string]*config.RouterInfo)
|
||||
return make(map[string]map[string]*dynamic.RouterInfo)
|
||||
}
|
||||
|
||||
// BuildHandlers Builds handler for all entry points
|
||||
|
@ -83,7 +83,7 @@ func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string, t
|
|||
return entryPointHandlers
|
||||
}
|
||||
|
||||
func (m *Manager) buildEntryPointHandler(ctx context.Context, configs map[string]*config.RouterInfo) (http.Handler, error) {
|
||||
func (m *Manager) buildEntryPointHandler(ctx context.Context, configs map[string]*dynamic.RouterInfo) (http.Handler, error) {
|
||||
router, err := rules.NewRouter()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -118,7 +118,7 @@ func (m *Manager) buildEntryPointHandler(ctx context.Context, configs map[string
|
|||
return chain.Then(router)
|
||||
}
|
||||
|
||||
func (m *Manager) buildRouterHandler(ctx context.Context, routerName string, routerConfig *config.RouterInfo) (http.Handler, error) {
|
||||
func (m *Manager) buildRouterHandler(ctx context.Context, routerName string, routerConfig *dynamic.RouterInfo) (http.Handler, error) {
|
||||
if handler, ok := m.routerHandlers[routerName]; ok {
|
||||
return handler, nil
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ func (m *Manager) buildRouterHandler(ctx context.Context, routerName string, rou
|
|||
return m.routerHandlers[routerName], nil
|
||||
}
|
||||
|
||||
func (m *Manager) buildHTTPHandler(ctx context.Context, router *config.RouterInfo, routerName string) (http.Handler, error) {
|
||||
func (m *Manager) buildHTTPHandler(ctx context.Context, router *dynamic.RouterInfo, routerName string) (http.Handler, error) {
|
||||
qualifiedNames := make([]string, len(router.Middlewares))
|
||||
for i, name := range router.Middlewares {
|
||||
qualifiedNames[i] = internal.GetQualifiedName(ctx, name)
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/containous/traefik/pkg/config"
|
||||
"github.com/containous/traefik/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/pkg/middlewares/accesslog"
|
||||
"github.com/containous/traefik/pkg/middlewares/requestdecorator"
|
||||
"github.com/containous/traefik/pkg/responsemodifiers"
|
||||
|
@ -30,25 +30,25 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
|
||||
testCases := []struct {
|
||||
desc string
|
||||
routersConfig map[string]*config.Router
|
||||
serviceConfig map[string]*config.Service
|
||||
middlewaresConfig map[string]*config.Middleware
|
||||
routersConfig map[string]*dynamic.Router
|
||||
serviceConfig map[string]*dynamic.Service
|
||||
middlewaresConfig map[string]*dynamic.Middleware
|
||||
entryPoints []string
|
||||
expected ExpectedResult
|
||||
}{
|
||||
{
|
||||
desc: "no middleware",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -61,14 +61,14 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "no load balancer",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {},
|
||||
},
|
||||
entryPoints: []string{"web"},
|
||||
|
@ -76,16 +76,16 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "no middleware, default entry point",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
Service: "foo-service",
|
||||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -98,17 +98,17 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "no middleware, no matching",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "Host(`bar.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -121,7 +121,7 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "middleware: headers > auth",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Middlewares: []string{"headers-middle", "auth-middle"},
|
||||
|
@ -129,10 +129,10 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -140,14 +140,14 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
middlewaresConfig: map[string]*config.Middleware{
|
||||
middlewaresConfig: map[string]*dynamic.Middleware{
|
||||
"auth-middle": {
|
||||
BasicAuth: &config.BasicAuth{
|
||||
BasicAuth: &dynamic.BasicAuth{
|
||||
Users: []string{"toto:titi"},
|
||||
},
|
||||
},
|
||||
"headers-middle": {
|
||||
Headers: &config.Headers{
|
||||
Headers: &dynamic.Headers{
|
||||
CustomRequestHeaders: map[string]string{"X-Apero": "beer"},
|
||||
},
|
||||
},
|
||||
|
@ -162,7 +162,7 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "middleware: auth > header",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Middlewares: []string{"auth-middle", "headers-middle"},
|
||||
|
@ -170,10 +170,10 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -181,14 +181,14 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
middlewaresConfig: map[string]*config.Middleware{
|
||||
middlewaresConfig: map[string]*dynamic.Middleware{
|
||||
"auth-middle": {
|
||||
BasicAuth: &config.BasicAuth{
|
||||
BasicAuth: &dynamic.BasicAuth{
|
||||
Users: []string{"toto:titi"},
|
||||
},
|
||||
},
|
||||
"headers-middle": {
|
||||
Headers: &config.Headers{
|
||||
Headers: &dynamic.Headers{
|
||||
CustomRequestHeaders: map[string]string{"X-Apero": "beer"},
|
||||
},
|
||||
},
|
||||
|
@ -203,17 +203,17 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "no middleware with provider name",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo@provider-1": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service@provider-1": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -226,17 +226,17 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "no middleware with specified provider name",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo@provider-1": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service@provider-2",
|
||||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service@provider-2": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -249,7 +249,7 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "middleware: chain with provider name",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo@provider-1": {
|
||||
EntryPoints: []string{"web"},
|
||||
Middlewares: []string{"chain-middle@provider-2", "headers-middle"},
|
||||
|
@ -257,10 +257,10 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service@provider-1": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -268,17 +268,17 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
middlewaresConfig: map[string]*config.Middleware{
|
||||
middlewaresConfig: map[string]*dynamic.Middleware{
|
||||
"chain-middle@provider-2": {
|
||||
Chain: &config.Chain{Middlewares: []string{"auth-middle"}},
|
||||
Chain: &dynamic.Chain{Middlewares: []string{"auth-middle"}},
|
||||
},
|
||||
"auth-middle@provider-2": {
|
||||
BasicAuth: &config.BasicAuth{
|
||||
BasicAuth: &dynamic.BasicAuth{
|
||||
Users: []string{"toto:titi"},
|
||||
},
|
||||
},
|
||||
"headers-middle@provider-1": {
|
||||
Headers: &config.Headers{
|
||||
Headers: &dynamic.Headers{
|
||||
CustomRequestHeaders: map[string]string{"X-Apero": "beer"},
|
||||
},
|
||||
},
|
||||
|
@ -298,8 +298,8 @@ func TestRouterManager_Get(t *testing.T) {
|
|||
t.Run(test.desc, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
rtConf := config.NewRuntimeConfig(config.Configuration{
|
||||
HTTP: &config.HTTPConfiguration{
|
||||
rtConf := dynamic.NewRuntimeConfig(dynamic.Configuration{
|
||||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Services: test.serviceConfig,
|
||||
Routers: test.routersConfig,
|
||||
Middlewares: test.middlewaresConfig,
|
||||
|
@ -332,15 +332,15 @@ func TestAccessLog(t *testing.T) {
|
|||
|
||||
testCases := []struct {
|
||||
desc string
|
||||
routersConfig map[string]*config.Router
|
||||
serviceConfig map[string]*config.Service
|
||||
middlewaresConfig map[string]*config.Middleware
|
||||
routersConfig map[string]*dynamic.Router
|
||||
serviceConfig map[string]*dynamic.Service
|
||||
middlewaresConfig map[string]*dynamic.Middleware
|
||||
entryPoints []string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
desc: "apply routerName in accesslog (first match)",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -352,10 +352,10 @@ func TestAccessLog(t *testing.T) {
|
|||
Rule: "Host(`bar.foo`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -368,7 +368,7 @@ func TestAccessLog(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "apply routerName in accesslog (second match)",
|
||||
routersConfig: map[string]*config.Router{
|
||||
routersConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -380,10 +380,10 @@ func TestAccessLog(t *testing.T) {
|
|||
Rule: "Host(`foo.bar`)",
|
||||
},
|
||||
},
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -399,8 +399,8 @@ func TestAccessLog(t *testing.T) {
|
|||
for _, test := range testCases {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
|
||||
rtConf := config.NewRuntimeConfig(config.Configuration{
|
||||
HTTP: &config.HTTPConfiguration{
|
||||
rtConf := dynamic.NewRuntimeConfig(dynamic.Configuration{
|
||||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Services: test.serviceConfig,
|
||||
Routers: test.routersConfig,
|
||||
Middlewares: test.middlewaresConfig,
|
||||
|
@ -438,17 +438,17 @@ func TestAccessLog(t *testing.T) {
|
|||
func TestRuntimeConfiguration(t *testing.T) {
|
||||
testCases := []struct {
|
||||
desc string
|
||||
serviceConfig map[string]*config.Service
|
||||
routerConfig map[string]*config.Router
|
||||
middlewareConfig map[string]*config.Middleware
|
||||
serviceConfig map[string]*dynamic.Service
|
||||
routerConfig map[string]*dynamic.Router
|
||||
middlewareConfig map[string]*dynamic.Middleware
|
||||
expectedError int
|
||||
}{
|
||||
{
|
||||
desc: "No error",
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://127.0.0.1:8085",
|
||||
},
|
||||
|
@ -456,14 +456,14 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
URL: "http://127.0.0.1:8086",
|
||||
},
|
||||
},
|
||||
HealthCheck: &config.HealthCheck{
|
||||
HealthCheck: &dynamic.HealthCheck{
|
||||
Interval: "500ms",
|
||||
Path: "/health",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.Router{
|
||||
routerConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -479,10 +479,10 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "One router with wrong rule",
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://127.0.0.1",
|
||||
},
|
||||
|
@ -490,7 +490,7 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.Router{
|
||||
routerConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -506,10 +506,10 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "All router with wrong rule",
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://127.0.0.1",
|
||||
},
|
||||
|
@ -517,7 +517,7 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.Router{
|
||||
routerConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -533,10 +533,10 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "Router with unknown service",
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://127.0.0.1",
|
||||
},
|
||||
|
@ -544,7 +544,7 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.Router{
|
||||
routerConfig: map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "wrong-service",
|
||||
|
@ -560,12 +560,12 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "Router with broken service",
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: nil,
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.Router{
|
||||
routerConfig: map[string]*dynamic.Router{
|
||||
"bar": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -576,10 +576,10 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "Router with middleware",
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://127.0.0.1",
|
||||
},
|
||||
|
@ -587,19 +587,19 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
middlewareConfig: map[string]*config.Middleware{
|
||||
middlewareConfig: map[string]*dynamic.Middleware{
|
||||
"auth": {
|
||||
BasicAuth: &config.BasicAuth{
|
||||
BasicAuth: &dynamic.BasicAuth{
|
||||
Users: []string{"admin:admin"},
|
||||
},
|
||||
},
|
||||
"addPrefixTest": {
|
||||
AddPrefix: &config.AddPrefix{
|
||||
AddPrefix: &dynamic.AddPrefix{
|
||||
Prefix: "/toto",
|
||||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.Router{
|
||||
routerConfig: map[string]*dynamic.Router{
|
||||
"bar": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -616,10 +616,10 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "Router with unknown middleware",
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://127.0.0.1",
|
||||
},
|
||||
|
@ -627,14 +627,14 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
middlewareConfig: map[string]*config.Middleware{
|
||||
middlewareConfig: map[string]*dynamic.Middleware{
|
||||
"auth": {
|
||||
BasicAuth: &config.BasicAuth{
|
||||
BasicAuth: &dynamic.BasicAuth{
|
||||
Users: []string{"admin:admin"},
|
||||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.Router{
|
||||
routerConfig: map[string]*dynamic.Router{
|
||||
"bar": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -647,10 +647,10 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
|
||||
{
|
||||
desc: "Router with broken middleware",
|
||||
serviceConfig: map[string]*config.Service{
|
||||
serviceConfig: map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "http://127.0.0.1",
|
||||
},
|
||||
|
@ -658,14 +658,14 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
middlewareConfig: map[string]*config.Middleware{
|
||||
middlewareConfig: map[string]*dynamic.Middleware{
|
||||
"auth": {
|
||||
BasicAuth: &config.BasicAuth{
|
||||
BasicAuth: &dynamic.BasicAuth{
|
||||
Users: []string{"foo"},
|
||||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.Router{
|
||||
routerConfig: map[string]*dynamic.Router{
|
||||
"bar": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -685,8 +685,8 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
|
||||
entryPoints := []string{"web"}
|
||||
|
||||
rtConf := config.NewRuntimeConfig(config.Configuration{
|
||||
HTTP: &config.HTTPConfiguration{
|
||||
rtConf := dynamic.NewRuntimeConfig(dynamic.Configuration{
|
||||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Services: test.serviceConfig,
|
||||
Routers: test.routerConfig,
|
||||
Middlewares: test.middlewareConfig,
|
||||
|
@ -694,7 +694,7 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
})
|
||||
serviceManager := service.NewManager(rtConf.Services, http.DefaultTransport)
|
||||
middlewaresBuilder := middleware.NewBuilder(rtConf.Middlewares, serviceManager)
|
||||
responseModifierFactory := responsemodifiers.NewBuilder(map[string]*config.MiddlewareInfo{})
|
||||
responseModifierFactory := responsemodifiers.NewBuilder(map[string]*dynamic.MiddlewareInfo{})
|
||||
routerManager := NewManager(rtConf, serviceManager, middlewaresBuilder, responseModifierFactory)
|
||||
|
||||
_ = routerManager.BuildHandlers(context.Background(), entryPoints, false)
|
||||
|
@ -739,17 +739,17 @@ func BenchmarkRouterServe(b *testing.B) {
|
|||
StatusCode: 200,
|
||||
Body: ioutil.NopCloser(strings.NewReader("")),
|
||||
}
|
||||
routersConfig := map[string]*config.Router{
|
||||
routersConfig := map[string]*dynamic.Router{
|
||||
"foo": {
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "Host(`foo.bar`) && Path(`/`)",
|
||||
},
|
||||
}
|
||||
serviceConfig := map[string]*config.Service{
|
||||
serviceConfig := map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: server.URL,
|
||||
},
|
||||
|
@ -759,11 +759,11 @@ func BenchmarkRouterServe(b *testing.B) {
|
|||
}
|
||||
entryPoints := []string{"web"}
|
||||
|
||||
rtConf := config.NewRuntimeConfig(config.Configuration{
|
||||
HTTP: &config.HTTPConfiguration{
|
||||
rtConf := dynamic.NewRuntimeConfig(dynamic.Configuration{
|
||||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Services: serviceConfig,
|
||||
Routers: routersConfig,
|
||||
Middlewares: map[string]*config.Middleware{},
|
||||
Middlewares: map[string]*dynamic.Middleware{},
|
||||
},
|
||||
})
|
||||
serviceManager := service.NewManager(rtConf.Services, &staticTransport{res})
|
||||
|
@ -790,10 +790,10 @@ func BenchmarkService(b *testing.B) {
|
|||
Body: ioutil.NopCloser(strings.NewReader("")),
|
||||
}
|
||||
|
||||
serviceConfig := map[string]*config.Service{
|
||||
serviceConfig := map[string]*dynamic.Service{
|
||||
"foo-service": {
|
||||
LoadBalancer: &config.LoadBalancerService{
|
||||
Servers: []config.Server{
|
||||
LoadBalancer: &dynamic.LoadBalancerService{
|
||||
Servers: []dynamic.Server{
|
||||
{
|
||||
URL: "tchouck",
|
||||
},
|
||||
|
@ -802,8 +802,8 @@ func BenchmarkService(b *testing.B) {
|
|||
},
|
||||
}
|
||||
|
||||
rtConf := config.NewRuntimeConfig(config.Configuration{
|
||||
HTTP: &config.HTTPConfiguration{
|
||||
rtConf := dynamic.NewRuntimeConfig(dynamic.Configuration{
|
||||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Services: serviceConfig,
|
||||
},
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/containous/traefik/pkg/config"
|
||||
"github.com/containous/traefik/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/pkg/log"
|
||||
"github.com/containous/traefik/pkg/rules"
|
||||
"github.com/containous/traefik/pkg/server/internal"
|
||||
|
@ -16,7 +16,7 @@ import (
|
|||
)
|
||||
|
||||
// NewManager Creates a new Manager
|
||||
func NewManager(conf *config.RuntimeConfiguration,
|
||||
func NewManager(conf *dynamic.RuntimeConfiguration,
|
||||
serviceManager *tcpservice.Manager,
|
||||
httpHandlers map[string]http.Handler,
|
||||
httpsHandlers map[string]http.Handler,
|
||||
|
@ -37,23 +37,23 @@ type Manager struct {
|
|||
httpHandlers map[string]http.Handler
|
||||
httpsHandlers map[string]http.Handler
|
||||
tlsManager *traefiktls.Manager
|
||||
conf *config.RuntimeConfiguration
|
||||
conf *dynamic.RuntimeConfiguration
|
||||
}
|
||||
|
||||
func (m *Manager) getTCPRouters(ctx context.Context, entryPoints []string) map[string]map[string]*config.TCPRouterInfo {
|
||||
func (m *Manager) getTCPRouters(ctx context.Context, entryPoints []string) map[string]map[string]*dynamic.TCPRouterInfo {
|
||||
if m.conf != nil {
|
||||
return m.conf.GetTCPRoutersByEntrypoints(ctx, entryPoints)
|
||||
}
|
||||
|
||||
return make(map[string]map[string]*config.TCPRouterInfo)
|
||||
return make(map[string]map[string]*dynamic.TCPRouterInfo)
|
||||
}
|
||||
|
||||
func (m *Manager) getHTTPRouters(ctx context.Context, entryPoints []string, tls bool) map[string]map[string]*config.RouterInfo {
|
||||
func (m *Manager) getHTTPRouters(ctx context.Context, entryPoints []string, tls bool) map[string]map[string]*dynamic.RouterInfo {
|
||||
if m.conf != nil {
|
||||
return m.conf.GetRoutersByEntrypoints(ctx, entryPoints, tls)
|
||||
}
|
||||
|
||||
return make(map[string]map[string]*config.RouterInfo)
|
||||
return make(map[string]map[string]*dynamic.RouterInfo)
|
||||
}
|
||||
|
||||
// BuildHandlers builds the handlers for the given entrypoints
|
||||
|
@ -79,7 +79,7 @@ func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string) m
|
|||
return entryPointHandlers
|
||||
}
|
||||
|
||||
func (m *Manager) buildEntryPointHandler(ctx context.Context, configs map[string]*config.TCPRouterInfo, configsHTTP map[string]*config.RouterInfo, handlerHTTP http.Handler, handlerHTTPS http.Handler) (*tcp.Router, error) {
|
||||
func (m *Manager) buildEntryPointHandler(ctx context.Context, configs map[string]*dynamic.TCPRouterInfo, configsHTTP map[string]*dynamic.RouterInfo, handlerHTTP http.Handler, handlerHTTPS http.Handler) (*tcp.Router, error) {
|
||||
router := &tcp.Router{}
|
||||
router.HTTPHandler(handlerHTTP)
|
||||
const defaultTLSConfigName = "default"
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/containous/traefik/pkg/config"
|
||||
"github.com/containous/traefik/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/pkg/server/service/tcp"
|
||||
"github.com/containous/traefik/pkg/tls"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -13,17 +13,17 @@ import (
|
|||
func TestRuntimeConfiguration(t *testing.T) {
|
||||
testCases := []struct {
|
||||
desc string
|
||||
serviceConfig map[string]*config.TCPServiceInfo
|
||||
routerConfig map[string]*config.TCPRouterInfo
|
||||
serviceConfig map[string]*dynamic.TCPServiceInfo
|
||||
routerConfig map[string]*dynamic.TCPRouterInfo
|
||||
expectedError int
|
||||
}{
|
||||
{
|
||||
desc: "No error",
|
||||
serviceConfig: map[string]*config.TCPServiceInfo{
|
||||
serviceConfig: map[string]*dynamic.TCPServiceInfo{
|
||||
"foo-service": {
|
||||
TCPService: &config.TCPService{
|
||||
LoadBalancer: &config.TCPLoadBalancerService{
|
||||
Servers: []config.TCPServer{
|
||||
TCPService: &dynamic.TCPService{
|
||||
LoadBalancer: &dynamic.TCPLoadBalancerService{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Port: "8085",
|
||||
Address: "127.0.0.1:8085",
|
||||
|
@ -37,25 +37,25 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.TCPRouterInfo{
|
||||
routerConfig: map[string]*dynamic.TCPRouterInfo{
|
||||
"foo": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "HostSNI(`bar.foo`)",
|
||||
TLS: &config.RouterTCPTLSConfig{
|
||||
TLS: &dynamic.RouterTCPTLSConfig{
|
||||
Passthrough: false,
|
||||
Options: "foo",
|
||||
},
|
||||
},
|
||||
},
|
||||
"bar": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "HostSNI(`foo.bar`)",
|
||||
TLS: &config.RouterTCPTLSConfig{
|
||||
TLS: &dynamic.RouterTCPTLSConfig{
|
||||
Passthrough: false,
|
||||
Options: "bar",
|
||||
},
|
||||
|
@ -66,11 +66,11 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "One router with wrong rule",
|
||||
serviceConfig: map[string]*config.TCPServiceInfo{
|
||||
serviceConfig: map[string]*dynamic.TCPServiceInfo{
|
||||
"foo-service": {
|
||||
TCPService: &config.TCPService{
|
||||
LoadBalancer: &config.TCPLoadBalancerService{
|
||||
Servers: []config.TCPServer{
|
||||
TCPService: &dynamic.TCPService{
|
||||
LoadBalancer: &dynamic.TCPLoadBalancerService{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Address: "127.0.0.1:80",
|
||||
},
|
||||
|
@ -79,9 +79,9 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.TCPRouterInfo{
|
||||
routerConfig: map[string]*dynamic.TCPRouterInfo{
|
||||
"foo": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "WrongRule(`bar.foo`)",
|
||||
|
@ -89,7 +89,7 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
|
||||
"bar": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "HostSNI(`foo.bar`)",
|
||||
|
@ -100,11 +100,11 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "All router with wrong rule",
|
||||
serviceConfig: map[string]*config.TCPServiceInfo{
|
||||
serviceConfig: map[string]*dynamic.TCPServiceInfo{
|
||||
"foo-service": {
|
||||
TCPService: &config.TCPService{
|
||||
LoadBalancer: &config.TCPLoadBalancerService{
|
||||
Servers: []config.TCPServer{
|
||||
TCPService: &dynamic.TCPService{
|
||||
LoadBalancer: &dynamic.TCPLoadBalancerService{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Address: "127.0.0.1:80",
|
||||
},
|
||||
|
@ -113,16 +113,16 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.TCPRouterInfo{
|
||||
routerConfig: map[string]*dynamic.TCPRouterInfo{
|
||||
"foo": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "WrongRule(`bar.foo`)",
|
||||
},
|
||||
},
|
||||
"bar": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "WrongRule(`foo.bar`)",
|
||||
|
@ -133,11 +133,11 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "Router with unknown service",
|
||||
serviceConfig: map[string]*config.TCPServiceInfo{
|
||||
serviceConfig: map[string]*dynamic.TCPServiceInfo{
|
||||
"foo-service": {
|
||||
TCPService: &config.TCPService{
|
||||
LoadBalancer: &config.TCPLoadBalancerService{
|
||||
Servers: []config.TCPServer{
|
||||
TCPService: &dynamic.TCPService{
|
||||
LoadBalancer: &dynamic.TCPLoadBalancerService{
|
||||
Servers: []dynamic.TCPServer{
|
||||
{
|
||||
Address: "127.0.0.1:80",
|
||||
},
|
||||
|
@ -146,16 +146,16 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.TCPRouterInfo{
|
||||
routerConfig: map[string]*dynamic.TCPRouterInfo{
|
||||
"foo": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "wrong-service",
|
||||
Rule: "HostSNI(`bar.foo`)",
|
||||
},
|
||||
},
|
||||
"bar": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
|
@ -167,16 +167,16 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
},
|
||||
{
|
||||
desc: "Router with broken service",
|
||||
serviceConfig: map[string]*config.TCPServiceInfo{
|
||||
serviceConfig: map[string]*dynamic.TCPServiceInfo{
|
||||
"foo-service": {
|
||||
TCPService: &config.TCPService{
|
||||
TCPService: &dynamic.TCPService{
|
||||
LoadBalancer: nil,
|
||||
},
|
||||
},
|
||||
},
|
||||
routerConfig: map[string]*config.TCPRouterInfo{
|
||||
routerConfig: map[string]*dynamic.TCPRouterInfo{
|
||||
"bar": {
|
||||
TCPRouter: &config.TCPRouter{
|
||||
TCPRouter: &dynamic.TCPRouter{
|
||||
EntryPoints: []string{"web"},
|
||||
Service: "foo-service",
|
||||
Rule: "HostSNI(`foo.bar`)",
|
||||
|
@ -195,7 +195,7 @@ func TestRuntimeConfiguration(t *testing.T) {
|
|||
|
||||
entryPoints := []string{"web"}
|
||||
|
||||
conf := &config.RuntimeConfiguration{
|
||||
conf := &dynamic.RuntimeConfiguration{
|
||||
TCPServices: test.serviceConfig,
|
||||
TCPRouters: test.routerConfig,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue