1
0
Fork 0

Add plugin's support for provider

Co-authored-by: Julien Salleyron <julien@traefik.io>
This commit is contained in:
Ludovic Fernandez 2021-05-11 16:14:10 +02:00 committed by GitHub
parent de2437cfec
commit 63ef0f1cee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 928 additions and 116 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"crypto/x509"
"encoding/json"
"fmt"
stdlog "log"
"net/http"
"os"
@ -235,6 +236,20 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
return nil, err
}
// Providers plugins
for s, i := range staticConfiguration.Providers.Plugin {
p, err := pluginBuilder.BuildProvider(s, i)
if err != nil {
return nil, fmt.Errorf("plugin: failed to build provider: %w", err)
}
err = providerAggregator.AddProvider(p)
if err != nil {
return nil, fmt.Errorf("plugin: failed to add provider: %w", err)
}
}
// Metrics
metricRegistries := registerMetricClients(staticConfiguration.Metrics)