Migrate rest provider

This commit is contained in:
SALLEYRON Julien 2018-12-03 11:32:05 +01:00 committed by Traefiker Bot
parent 5d91c7e15c
commit c815a732ef
11 changed files with 185 additions and 4 deletions

View file

@ -24,7 +24,9 @@ func NewRouteAppenderAggregator(ctx context.Context, chainBuilder chainBuilder,
aggregator := &RouteAppenderAggregator{}
// FIXME add REST
if conf.Providers != nil && conf.Providers.Rest != nil {
aggregator.AddAppender(conf.Providers.Rest)
}
if conf.API != nil && conf.API.EntryPoint == entryPointName {
chain, err := chainBuilder.BuildChain(ctx, conf.API.Middlewares)

View file

@ -59,6 +59,21 @@ func TestRouterManager_Get(t *testing.T) {
entryPoints: []string{"web"},
expected: ExpectedResult{StatusCode: http.StatusOK},
},
{
desc: "no load balancer",
routersConfig: map[string]*config.Router{
"foo": {
EntryPoints: []string{"web"},
Service: "foo-service",
Rule: "Host:foo.bar",
},
},
serviceConfig: map[string]*config.Service{
"foo-service": {},
},
entryPoints: []string{"web"},
expected: ExpectedResult{StatusCode: http.StatusNotFound},
},
{
desc: "no middleware, default entry point",
routersConfig: map[string]*config.Router{