Add plugin's support for provider
Co-authored-by: Julien Salleyron <julien@traefik.io>
This commit is contained in:
parent
de2437cfec
commit
63ef0f1cee
24 changed files with 928 additions and 116 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue