Create init method on provider interface
This commit is contained in:
parent
b2a57ca1f3
commit
027093a5a5
52 changed files with 2760 additions and 131 deletions
|
@ -27,9 +27,14 @@ type Provider struct {
|
|||
TraefikFile string
|
||||
}
|
||||
|
||||
// Init the provider
|
||||
func (p *Provider) Init(constraints types.Constraints) error {
|
||||
return p.BaseProvider.Init(constraints)
|
||||
}
|
||||
|
||||
// Provide allows the file provider to provide configurations to traefik
|
||||
// using the given configuration channel.
|
||||
func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool, constraints types.Constraints) error {
|
||||
func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *safe.Pool) error {
|
||||
configuration, err := p.BuildConfiguration()
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -198,7 +198,7 @@ func TestProvideWithoutWatch(t *testing.T) {
|
|||
configChan := make(chan types.ConfigMessage)
|
||||
|
||||
go func() {
|
||||
err := provider.Provide(configChan, safe.NewPool(context.Background()), types.Constraints{})
|
||||
err := provider.Provide(configChan, safe.NewPool(context.Background()))
|
||||
assert.NoError(t, err)
|
||||
}()
|
||||
|
||||
|
@ -226,7 +226,7 @@ func TestProvideWithWatch(t *testing.T) {
|
|||
configChan := make(chan types.ConfigMessage)
|
||||
|
||||
go func() {
|
||||
err := provider.Provide(configChan, safe.NewPool(context.Background()), types.Constraints{})
|
||||
err := provider.Provide(configChan, safe.NewPool(context.Background()))
|
||||
assert.NoError(t, err)
|
||||
}()
|
||||
|
||||
|
@ -276,7 +276,7 @@ func TestErrorWhenEmptyConfig(t *testing.T) {
|
|||
configChan := make(chan types.ConfigMessage)
|
||||
errorChan := make(chan struct{})
|
||||
go func() {
|
||||
err := provider.Provide(configChan, safe.NewPool(context.Background()), types.Constraints{})
|
||||
err := provider.Provide(configChan, safe.NewPool(context.Background()))
|
||||
assert.Error(t, err)
|
||||
close(errorChan)
|
||||
}()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue