Improve error on router without service.
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
parent
c39a550b00
commit
1800b0b69c
13 changed files with 125 additions and 40 deletions
|
@ -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 §ion{
|
||||
Total: len(middlewares),
|
||||
Warnings: 0,
|
||||
Warnings: countWarnings,
|
||||
Errors: countErrors,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue