Disable router when a rule has an error

This commit is contained in:
Ludovic Fernandez 2020-12-17 10:06:03 +01:00 committed by GitHub
parent ac8e47579b
commit 63f65e5b2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 1 deletions

View file

@ -62,6 +62,29 @@ func TestRouterManager_Get(t *testing.T) {
entryPoints: []string{"web"},
expected: expectedResult{StatusCode: http.StatusOK},
},
{
desc: "empty host",
routersConfig: map[string]*dynamic.Router{
"foo": {
EntryPoints: []string{"web"},
Service: "foo-service",
Rule: "Host(``)",
},
},
serviceConfig: map[string]*dynamic.Service{
"foo-service": {
LoadBalancer: &dynamic.ServersLoadBalancer{
Servers: []dynamic.Server{
{
URL: server.URL,
},
},
},
},
},
entryPoints: []string{"web"},
expected: expectedResult{StatusCode: http.StatusNotFound},
},
{
desc: "no load balancer",
routersConfig: map[string]*dynamic.Router{