From e96879b4058fe2f8887e1670e701d21cc5d78d26 Mon Sep 17 00:00:00 2001 From: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Date: Fri, 17 May 2024 15:59:25 -0400 Subject: [PATCH] [chore] Remove usage of `Providers` in `confmap.ResolverSettings` (#33113) **Description:** `Providers` has been deprecated since v0.99.0. Needed for https://github.com/open-telemetry/opentelemetry-collector/pull/10173. --- exporter/datadogexporter/integrationtest/integration_test.go | 5 ++--- exporter/elasticsearchexporter/integrationtest/collector.go | 5 ++--- .../prometheusreceiver/internal/staleness_end_to_end_test.go | 5 ++--- testbed/testbed/in_process_collector.go | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/exporter/datadogexporter/integrationtest/integration_test.go b/exporter/datadogexporter/integrationtest/integration_test.go index fc85bd4ed38d..6e8494ee1af9 100644 --- a/exporter/datadogexporter/integrationtest/integration_test.go +++ b/exporter/datadogexporter/integrationtest/integration_test.go @@ -271,12 +271,11 @@ func getIntegrationTestCollector(t *testing.T, cfgStr string, url string, factor _, err = otelcoltest.LoadConfigAndValidate(confFile.Name(), factories) require.NoError(t, err, "All yaml config must be valid.") - fmp := fileprovider.NewFactory().Create(confmap.ProviderSettings{}) configProvider, err := otelcol.NewConfigProvider( otelcol.ConfigProviderSettings{ ResolverSettings: confmap.ResolverSettings{ - URIs: []string{confFile.Name()}, - Providers: map[string]confmap.Provider{fmp.Scheme(): fmp}, + URIs: []string{confFile.Name()}, + ProviderFactories: []confmap.ProviderFactory{fileprovider.NewFactory()}, }, }) require.NoError(t, err) diff --git a/exporter/elasticsearchexporter/integrationtest/collector.go b/exporter/elasticsearchexporter/integrationtest/collector.go index 293b526afbf0..5fae9172a27b 100644 --- a/exporter/elasticsearchexporter/integrationtest/collector.go +++ b/exporter/elasticsearchexporter/integrationtest/collector.go @@ -167,11 +167,10 @@ func (c *recreatableOtelCol) Start(_ testbed.StartParams) error { return err } - fmp := fileprovider.NewFactory().Create(confmap.ProviderSettings{}) cfgProviderSettings := otelcol.ConfigProviderSettings{ ResolverSettings: confmap.ResolverSettings{ - URIs: []string{confFile.Name()}, - Providers: map[string]confmap.Provider{fmp.Scheme(): fmp}, + URIs: []string{confFile.Name()}, + ProviderFactories: []confmap.ProviderFactory{fileprovider.NewFactory()}, }, } diff --git a/receiver/prometheusreceiver/internal/staleness_end_to_end_test.go b/receiver/prometheusreceiver/internal/staleness_end_to_end_test.go index de8fb56b1926..5e170280ad45 100644 --- a/receiver/prometheusreceiver/internal/staleness_end_to_end_test.go +++ b/receiver/prometheusreceiver/internal/staleness_end_to_end_test.go @@ -146,12 +146,11 @@ service: Processors: processors, } - fmp := fileprovider.NewFactory().Create(confmap.ProviderSettings{}) configProvider, err := otelcol.NewConfigProvider( otelcol.ConfigProviderSettings{ ResolverSettings: confmap.ResolverSettings{ - URIs: []string{confFile.Name()}, - Providers: map[string]confmap.Provider{fmp.Scheme(): fmp}, + URIs: []string{confFile.Name()}, + ProviderFactories: []confmap.ProviderFactory{fileprovider.NewFactory()}, }, }) require.NoError(t, err) diff --git a/testbed/testbed/in_process_collector.go b/testbed/testbed/in_process_collector.go index 557a4b08cad9..766417466dd2 100644 --- a/testbed/testbed/in_process_collector.go +++ b/testbed/testbed/in_process_collector.go @@ -57,12 +57,11 @@ func (ipp *inProcessCollector) Start(_ StartParams) error { } ipp.configFile = confFile.Name() - fmp := fileprovider.NewFactory().Create(confmap.ProviderSettings{}) configProvider, err := otelcol.NewConfigProvider( otelcol.ConfigProviderSettings{ ResolverSettings: confmap.ResolverSettings{ - URIs: []string{ipp.configFile}, - Providers: map[string]confmap.Provider{fmp.Scheme(): fmp}, + URIs: []string{ipp.configFile}, + ProviderFactories: []confmap.ProviderFactory{fileprovider.NewFactory()}, }, }) if err != nil {