Improve error on router without service.

Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
Ludovic Fernandez 2019-07-19 16:42:04 +02:00 committed by Traefiker Bot
parent c39a550b00
commit 1800b0b69c
13 changed files with 125 additions and 40 deletions

View file

@ -100,15 +100,19 @@ func getHTTPServiceSection(services map[string]*runtime.ServiceInfo) *section {
func getHTTPMiddlewareSection(middlewares map[string]*runtime.MiddlewareInfo) *section {
var countErrors int
for _, md := range middlewares {
if md.Err != nil {
var countWarnings int
for _, mid := range middlewares {
switch mid.Status {
case runtime.StatusDisabled:
countErrors++
case runtime.StatusWarning:
countWarnings++
}
}
return &section{
Total: len(middlewares),
Warnings: 0,
Warnings: countWarnings,
Errors: countErrors,
}
}