Move dynamic config into a dedicated package.
This commit is contained in:
parent
09cc1161c9
commit
c8bf8e896a
102 changed files with 3170 additions and 3166 deletions
|
@ -10,7 +10,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff"
|
||||
"github.com/containous/traefik/pkg/config"
|
||||
"github.com/containous/traefik/pkg/config/dynamic"
|
||||
"github.com/containous/traefik/pkg/job"
|
||||
"github.com/containous/traefik/pkg/log"
|
||||
"github.com/containous/traefik/pkg/provider"
|
||||
|
@ -106,7 +106,7 @@ func (p *Provider) Init() error {
|
|||
|
||||
// Provide allows the marathon provider to provide configurations to traefik
|
||||
// using the given configuration channel.
|
||||
func (p *Provider) Provide(configurationChan chan<- config.Message, pool *safe.Pool) error {
|
||||
func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.Pool) error {
|
||||
ctx := log.With(context.Background(), log.Str(log.ProviderName, "marathon"))
|
||||
logger := log.FromContext(ctx)
|
||||
|
||||
|
@ -171,7 +171,7 @@ func (p *Provider) Provide(configurationChan chan<- config.Message, pool *safe.P
|
|||
|
||||
conf := p.getConfigurations(ctx)
|
||||
if conf != nil {
|
||||
configurationChan <- config.Message{
|
||||
configurationChan <- dynamic.Message{
|
||||
ProviderName: "marathon",
|
||||
Configuration: conf,
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ func (p *Provider) Provide(configurationChan chan<- config.Message, pool *safe.P
|
|||
}
|
||||
|
||||
configuration := p.getConfigurations(ctx)
|
||||
configurationChan <- config.Message{
|
||||
configurationChan <- dynamic.Message{
|
||||
ProviderName: "marathon",
|
||||
Configuration: configuration,
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ func (p *Provider) Provide(configurationChan chan<- config.Message, pool *safe.P
|
|||
return nil
|
||||
}
|
||||
|
||||
func (p *Provider) getConfigurations(ctx context.Context) *config.Configuration {
|
||||
func (p *Provider) getConfigurations(ctx context.Context) *dynamic.Configuration {
|
||||
applications, err := p.getApplications()
|
||||
if err != nil {
|
||||
log.FromContext(ctx).Errorf("Failed to retrieve Marathon applications: %v", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue