diff --git a/pkg/provider/consulcatalog/consul_catalog.go b/pkg/provider/consulcatalog/consul_catalog.go index 3f0815f1a..af8c7e2f7 100644 --- a/pkg/provider/consulcatalog/consul_catalog.go +++ b/pkg/provider/consulcatalog/consul_catalog.go @@ -233,12 +233,12 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctxLog), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to consul catalog server") + logger.Error().Err(err).Msg("Cannot retrieve data") } }) diff --git a/pkg/provider/docker/docker.go b/pkg/provider/docker/docker.go index eefd737ad..2e902cf8a 100644 --- a/pkg/provider/docker/docker.go +++ b/pkg/provider/docker/docker.go @@ -329,11 +329,11 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctxLog), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to docker server") + logger.Error().Err(err).Msg("Cannot retrieve data") } }) diff --git a/pkg/provider/ecs/ecs.go b/pkg/provider/ecs/ecs.go index ac78b5d6f..22e3e5695 100644 --- a/pkg/provider/ecs/ecs.go +++ b/pkg/provider/ecs/ecs.go @@ -183,11 +183,11 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), routineCtx), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to Provider api") + logger.Error().Err(err).Msg("Cannot retrieve data") } }) diff --git a/pkg/provider/http/http.go b/pkg/provider/http/http.go index 776c9de1b..e8ad5b8e7 100644 --- a/pkg/provider/http/http.go +++ b/pkg/provider/http/http.go @@ -97,11 +97,11 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctxLog), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to server endpoint") + logger.Error().Err(err).Msg("Cannot retrieve data") } }) diff --git a/pkg/provider/http/http_test.go b/pkg/provider/http/http_test.go index 7a0477dd0..97f020c3b 100644 --- a/pkg/provider/http/http_test.go +++ b/pkg/provider/http/http_test.go @@ -146,7 +146,7 @@ func TestProvider_decodeConfiguration(t *testing.T) { }, { desc: "should return the decoded dynamic configuration", - configData: []byte("{\"tcp\":{\"routers\":{\"foo\":{}}}}"), + configData: []byte(`{"tcp":{"routers":{"foo":{}}}}`), expConfig: &dynamic.Configuration{ HTTP: &dynamic.HTTPConfiguration{ Routers: make(map[string]*dynamic.Router), diff --git a/pkg/provider/kubernetes/crd/kubernetes.go b/pkg/provider/kubernetes/crd/kubernetes.go index 299f3f803..f2054d09e 100644 --- a/pkg/provider/kubernetes/crd/kubernetes.go +++ b/pkg/provider/kubernetes/crd/kubernetes.go @@ -168,11 +168,11 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctxPool), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to Provider") + logger.Error().Err(err).Msg("Cannot retrieve data") } }) diff --git a/pkg/provider/kubernetes/gateway/kubernetes.go b/pkg/provider/kubernetes/gateway/kubernetes.go index f06bdac9b..3f62e98a2 100644 --- a/pkg/provider/kubernetes/gateway/kubernetes.go +++ b/pkg/provider/kubernetes/gateway/kubernetes.go @@ -162,11 +162,11 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctxPool), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to Provider") + logger.Error().Err(err).Msg("Cannot retrieve data") } }) diff --git a/pkg/provider/kubernetes/ingress/kubernetes.go b/pkg/provider/kubernetes/ingress/kubernetes.go index 206f37d50..95a71c12d 100644 --- a/pkg/provider/kubernetes/ingress/kubernetes.go +++ b/pkg/provider/kubernetes/ingress/kubernetes.go @@ -169,12 +169,12 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctxPool), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to Provider") + logger.Error().Err(err).Msg("Cannot retrieve data") } }) diff --git a/pkg/provider/kv/kv.go b/pkg/provider/kv/kv.go index abc25a84d..f6697b821 100644 --- a/pkg/provider/kv/kv.go +++ b/pkg/provider/kv/kv.go @@ -85,7 +85,7 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. err := p.watchKv(ctxLog, configurationChan) if err != nil { - logger.Error().Err(err).Msg("Cannot watch KV store") + logger.Error().Err(err).Msg("Cannot retrieve data") } }) @@ -124,15 +124,11 @@ func (p *Provider) watchKv(ctx context.Context, configurationChan chan<- dynamic } notify := func(err error, time time.Duration) { - log.Ctx(ctx).Error().Err(err).Msgf("KV connection error, retrying in %s", time) + log.Ctx(ctx).Error().Err(err).Msgf("Provider error, retrying in %s", time) } - err := backoff.RetryNotify(safe.OperationWithRecover(operation), + return backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctx), notify) - if err != nil { - return fmt.Errorf("cannot connect to KV server: %w", err) - } - return nil } func (p *Provider) buildConfiguration(ctx context.Context) (*dynamic.Configuration, error) { diff --git a/pkg/provider/marathon/marathon.go b/pkg/provider/marathon/marathon.go index 423573e66..d4e8cccd8 100644 --- a/pkg/provider/marathon/marathon.go +++ b/pkg/provider/marathon/marathon.go @@ -192,11 +192,11 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctx), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to Provider server") + logger.Error().Err(err).Msg("Cannot retrieve data") } return nil } diff --git a/pkg/provider/rancher/rancher.go b/pkg/provider/rancher/rancher.go index 8f74dcc21..212c6607c 100644 --- a/pkg/provider/rancher/rancher.go +++ b/pkg/provider/rancher/rancher.go @@ -140,11 +140,11 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe. } notify := func(err error, time time.Duration) { - logger.Error().Err(err).Msgf("Provider connection error, retrying in %s", time) + logger.Error().Err(err).Msgf("Provider error, retrying in %s", time) } err := backoff.RetryNotify(safe.OperationWithRecover(operation), backoff.WithContext(job.NewBackOff(backoff.NewExponentialBackOff()), ctxLog), notify) if err != nil { - logger.Error().Err(err).Msg("Cannot connect to Provider server") + logger.Error().Err(err).Msg("Cannot retrieve data") } })