fix: allow starting Traefik even if plugin services have an issue

This commit is contained in:
Ludovic Fernandez 2022-09-02 11:44:08 +02:00 committed by GitHub
parent d3e4d56a0d
commit d9589878fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View file

@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"net/http"
"reflect"
"strings"
"github.com/containous/alice"
@ -340,7 +341,7 @@ func (b *Builder) buildConstructor(ctx context.Context, middlewareName string) (
}
// Plugin
if config.Plugin != nil {
if config.Plugin != nil && !reflect.ValueOf(b.pluginBuilder).IsNil() { // Using "reflect" because "b.pluginBuilder" is an interface.
if middleware != nil {
return nil, badConf
}