From 8ce705fd6bbbb191990e5bb1538ba65640af091e Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Mon, 18 Mar 2024 09:43:57 -0600 Subject: [PATCH] Remove use of deprecated configtls structs --- cmd/configschema/comments_test.go | 2 +- cmd/configschema/common_test.go | 14 +++++------ cmd/configschema/docsgen/docsgen/template.go | 4 ++-- .../docsgen/testdata/otlp-receiver.json | 4 ++-- .../examples/supervisor_darwin.yaml | 2 +- .../examples/supervisor_linux.yaml | 2 +- .../examples/supervisor_windows.yaml | 2 +- .../supervisor/config/config.go | 2 +- .../alertmanager_exporter_test.go | 10 ++++---- exporter/alertmanagerexporter/config_test.go | 4 ++-- exporter/coralogixexporter/config_test.go | 16 ++++++------- exporter/coralogixexporter/factory_test.go | 8 +++---- .../metrics_exporter_test.go | 4 ++-- exporter/elasticsearchexporter/config.go | 2 +- .../elasticsearch_bulk.go | 2 +- exporter/instanaexporter/config_test.go | 4 ++-- exporter/instanaexporter/exporter_test.go | 8 +++---- exporter/instanaexporter/factory_test.go | 4 ++-- exporter/kafkaexporter/kafka_exporter_test.go | 4 ++-- exporter/lokiexporter/config_test.go | 4 ++-- exporter/opencensusexporter/config_test.go | 4 ++-- exporter/opencensusexporter/factory_test.go | 12 +++++----- .../opencensusexporter/opencensus_test.go | 12 +++++----- exporter/otelarrowexporter/config_test.go | 4 ++-- exporter/otelarrowexporter/factory_test.go | 10 ++++---- exporter/prometheusexporter/config_test.go | 4 ++-- .../prometheusexporter/prometheus_test.go | 8 +++---- .../config_test.go | 4 ++-- .../exporter_test.go | 4 ++-- .../factory_test.go | 4 ++-- exporter/signalfxexporter/config.go | 4 ++-- exporter/signalfxexporter/exporter_test.go | 24 +++++++++---------- .../internal/correlation/correlation_test.go | 4 ++-- exporter/skywalkingexporter/config_test.go | 4 ++-- exporter/skywalkingexporter/factory_test.go | 10 ++++---- .../skywalking_benchmark_test.go | 2 +- .../skywalkingexporter/skywalking_test.go | 4 ++-- exporter/splunkhecexporter/config_test.go | 4 ++-- exporter/syslogexporter/config.go | 2 +- exporter/syslogexporter/exporter_test.go | 10 ++++---- exporter/zipkinexporter/config_test.go | 2 +- extension/awsproxy/config_test.go | 2 +- extension/awsproxy/factory.go | 2 +- extension/healthcheckextension/config_test.go | 4 ++-- .../httpforwarderextension/extension_test.go | 4 ++-- .../jaegerremotesampling/extension_test.go | 2 +- extension/oauth2clientauthextension/config.go | 2 +- .../oauth2clientauthextension/config_test.go | 4 ++-- .../extension_test.go | 8 +++---- extension/opampextension/config.go | 6 ++--- extension/opampextension/config_test.go | 4 ++-- internal/aws/proxy/cfg.go | 4 ++-- internal/kafka/authentication.go | 10 ++++---- internal/kafka/authentication_test.go | 8 +++---- internal/kubelet/client_config.go | 4 ++-- internal/kubelet/client_test.go | 4 ++-- .../operator/input/syslog/config_test.go | 4 ++-- pkg/stanza/operator/input/tcp/config_test.go | 4 ++-- pkg/stanza/operator/input/tcp/tcp.go | 16 ++++++------- pkg/stanza/operator/input/tcp/tcp_test.go | 8 +++---- .../resourcedetectionprocessor/config_test.go | 2 +- .../internal/openshift/config.go | 2 +- receiver/aerospikereceiver/config.go | 2 +- receiver/aerospikereceiver/config_test.go | 8 +++---- receiver/apachereceiver/scraper_test.go | 4 ++-- receiver/awsfirehosereceiver/config_test.go | 4 ++-- receiver/awsxrayreceiver/config_test.go | 4 ++-- receiver/bigipreceiver/client_test.go | 6 ++--- receiver/bigipreceiver/scraper_test.go | 6 ++--- receiver/cloudflarereceiver/config.go | 10 ++++---- receiver/cloudflarereceiver/config_test.go | 16 ++++++------- .../logs_integration_test.go | 4 ++-- receiver/cloudflarereceiver/logs_test.go | 4 ++-- receiver/cloudfoundryreceiver/config_test.go | 6 ++--- receiver/cloudfoundryreceiver/factory.go | 2 +- receiver/couchdbreceiver/client_test.go | 4 ++-- receiver/couchdbreceiver/factory.go | 2 +- .../elasticsearchreceiver/scraper_test.go | 4 ++-- receiver/flinkmetricsreceiver/client_test.go | 6 ++--- receiver/flinkmetricsreceiver/scraper_test.go | 6 ++--- receiver/httpcheckreceiver/scraper_test.go | 6 ++--- receiver/jaegerreceiver/config_test.go | 4 ++-- receiver/jaegerreceiver/factory_test.go | 8 +++---- .../jaegerreceiver/trace_receiver_test.go | 4 ++-- receiver/kafkametricsreceiver/config_test.go | 4 ++-- .../kafkametricsreceiver/receiver_test.go | 4 ++-- receiver/kafkareceiver/config_test.go | 8 +++---- receiver/kafkareceiver/kafka_receiver_test.go | 12 +++++----- receiver/kubeletstatsreceiver/config_test.go | 2 +- receiver/kubeletstatsreceiver/factory_test.go | 2 +- receiver/mongodbatlasreceiver/alerts.go | 2 +- .../alerts_integration_test.go | 4 ++-- receiver/mongodbatlasreceiver/config.go | 10 ++++---- receiver/mongodbatlasreceiver/config_test.go | 8 +++---- receiver/mongodbatlasreceiver/factory_test.go | 2 +- receiver/mongodbreceiver/config.go | 2 +- receiver/mongodbreceiver/config_test.go | 16 ++++++------- receiver/mongodbreceiver/factory.go | 2 +- receiver/mysqlreceiver/config.go | 4 ++-- receiver/nginxreceiver/scraper_test.go | 4 ++-- receiver/opencensusreceiver/config_test.go | 4 ++-- .../opencensusreceiver/opencensus_test.go | 4 ++-- receiver/otelarrowreceiver/config_test.go | 4 ++-- receiver/postgresqlreceiver/client.go | 4 ++-- receiver/postgresqlreceiver/client_factory.go | 4 ++-- receiver/postgresqlreceiver/config.go | 2 +- receiver/postgresqlreceiver/config_test.go | 4 ++-- receiver/postgresqlreceiver/factory.go | 2 +- receiver/rabbitmqreceiver/client_test.go | 6 ++--- receiver/rabbitmqreceiver/scraper_test.go | 6 ++--- receiver/redisreceiver/config.go | 2 +- receiver/redisreceiver/config_test.go | 2 +- receiver/redisreceiver/factory.go | 2 +- receiver/redisreceiver/redis_scraper_test.go | 4 ++-- receiver/riakreceiver/client_test.go | 6 ++--- receiver/riakreceiver/scraper_test.go | 6 ++--- receiver/saphanareceiver/client.go | 2 +- receiver/saphanareceiver/config.go | 2 +- receiver/saphanareceiver/factory.go | 2 +- receiver/sapmreceiver/config_test.go | 4 ++-- receiver/sapmreceiver/trace_receiver_test.go | 8 +++---- receiver/signalfxreceiver/config_test.go | 4 ++-- receiver/signalfxreceiver/receiver_test.go | 8 +++---- .../simpleprometheusreceiver/config_test.go | 6 ++--- receiver/simpleprometheusreceiver/factory.go | 2 +- receiver/simpleprometheusreceiver/receiver.go | 4 ++-- .../simpleprometheusreceiver/receiver_test.go | 16 ++++++------- receiver/skywalkingreceiver/factory_test.go | 8 +++---- receiver/solacereceiver/config.go | 2 +- receiver/solacereceiver/config_test.go | 2 +- receiver/solacereceiver/factory.go | 2 +- .../solacereceiver/messaging_service_test.go | 8 +++---- receiver/splunkhecreceiver/config_test.go | 4 ++-- receiver/splunkhecreceiver/receiver_test.go | 8 +++---- receiver/vcenterreceiver/README.md | 2 +- receiver/vcenterreceiver/client_test.go | 2 +- receiver/vcenterreceiver/config.go | 2 +- receiver/vcenterreceiver/config_test.go | 2 +- receiver/vcenterreceiver/factory.go | 2 +- receiver/vcenterreceiver/integration_test.go | 2 +- testbed/datasenders/jaeger.go | 2 +- testbed/datasenders/opencensus.go | 2 +- testbed/testbed/senders.go | 4 ++-- 143 files changed, 361 insertions(+), 361 deletions(-) diff --git a/cmd/configschema/comments_test.go b/cmd/configschema/comments_test.go index 06880828840e..2d906a3d3968 100644 --- a/cmd/configschema/comments_test.go +++ b/cmd/configschema/comments_test.go @@ -35,7 +35,7 @@ func TestExternalType(t *testing.T) { } func TestSubPackage(t *testing.T) { - s := configtls.TLSClientSetting{} + s := configtls.ClientConfig{} v := reflect.ValueOf(s) _, err := commentsForStruct(v, testDR()) require.NoError(t, err) diff --git a/cmd/configschema/common_test.go b/cmd/configschema/common_test.go index e55401bfd71b..3287e534ea3c 100644 --- a/cmd/configschema/common_test.go +++ b/cmd/configschema/common_test.go @@ -22,13 +22,13 @@ type testStruct struct { Four bool `mapstructure:"four"` // embedded, package qualified comment time.Duration `mapstructure:"duration"` - Squashed testPerson `mapstructure:",squash"` - PersonPtr *testPerson `mapstructure:"person_ptr"` - PersonStruct testPerson `mapstructure:"person_struct"` - Persons []testPerson `mapstructure:"persons"` - PersonPtrs []*testPerson `mapstructure:"person_ptrs"` - Ignored string `mapstructure:"-"` - TLS configtls.TLSClientSetting `mapstructure:"tls"` + Squashed testPerson `mapstructure:",squash"` + PersonPtr *testPerson `mapstructure:"person_ptr"` + PersonStruct testPerson `mapstructure:"person_struct"` + Persons []testPerson `mapstructure:"persons"` + PersonPtrs []*testPerson `mapstructure:"person_ptrs"` + Ignored string `mapstructure:"-"` + TLS configtls.ClientConfig `mapstructure:"tls"` } func testDR() DirResolver { diff --git a/cmd/configschema/docsgen/docsgen/template.go b/cmd/configschema/docsgen/docsgen/template.go index 1c5d7a2a6359..4475c859161b 100644 --- a/cmd/configschema/docsgen/docsgen/template.go +++ b/cmd/configschema/docsgen/docsgen/template.go @@ -28,14 +28,14 @@ func join(s string) string { return strings.ReplaceAll(s, "\n", " ") } -// mkAnchor takes a name and a type (e.g. "configtls.TLSClientSetting") and +// mkAnchor takes a name and a type (e.g. "configtls.ClientConfig") and // returns a string suitable for use as a markdown anchor. func mkAnchor(name, typ string) string { if isDuration(typ) { return "time-Duration" } idx := strings.IndexRune(typ, '.') - // strip "configtls." from e.g. "configtls.TLSClientSetting" + // strip "configtls." from e.g. "configtls.ClientConfig" typeStripped := typ[idx+1:] concat := fmt.Sprintf("%s-%s", name, typeStripped) asterisksRemoved := strings.ReplaceAll(concat, "*", "") diff --git a/cmd/configschema/docsgen/docsgen/testdata/otlp-receiver.json b/cmd/configschema/docsgen/docsgen/testdata/otlp-receiver.json index c1a1f0a71b07..b7d9f54fe147 100644 --- a/cmd/configschema/docsgen/docsgen/testdata/otlp-receiver.json +++ b/cmd/configschema/docsgen/docsgen/testdata/otlp-receiver.json @@ -37,7 +37,7 @@ }, { "Name": "tls_settings", - "Type": "*configtls.TLSServerSetting", + "Type": "*configtls.ServerConfig", "Kind": "ptr", "Default": null, "Doc": "Configures the protocol to use TLS.\nThe default value is nil, which will cause the protocol to not use TLS.\n", @@ -276,7 +276,7 @@ }, { "Name": "tls_settings", - "Type": "*configtls.TLSServerSetting", + "Type": "*configtls.ServerConfig", "Kind": "ptr", "Default": null, "Doc": "TLSSetting struct exposes TLS client configuration.\n", diff --git a/cmd/opampsupervisor/examples/supervisor_darwin.yaml b/cmd/opampsupervisor/examples/supervisor_darwin.yaml index 379792377882..80d5b8bb5755 100644 --- a/cmd/opampsupervisor/examples/supervisor_darwin.yaml +++ b/cmd/opampsupervisor/examples/supervisor_darwin.yaml @@ -4,7 +4,7 @@ server: # Disable verification to test locally. # Don't do this in production. insecure_skip_verify: true - # For more TLS settings see config/configtls.TLSClientSetting + # For more TLS settings see config/configtls.ClientConfig capabilities: reports_effective_config: true diff --git a/cmd/opampsupervisor/examples/supervisor_linux.yaml b/cmd/opampsupervisor/examples/supervisor_linux.yaml index 0c2cf5ce8430..00021ece6b40 100644 --- a/cmd/opampsupervisor/examples/supervisor_linux.yaml +++ b/cmd/opampsupervisor/examples/supervisor_linux.yaml @@ -4,7 +4,7 @@ server: # Disable verification to test locally. # Don't do this in production. insecure_skip_verify: true - # For more TLS settings see config/configtls.TLSClientSetting + # For more TLS settings see config/configtls.ClientConfig capabilities: reports_effective_config: true diff --git a/cmd/opampsupervisor/examples/supervisor_windows.yaml b/cmd/opampsupervisor/examples/supervisor_windows.yaml index 35c20b62ca21..13d0a911d78d 100644 --- a/cmd/opampsupervisor/examples/supervisor_windows.yaml +++ b/cmd/opampsupervisor/examples/supervisor_windows.yaml @@ -4,7 +4,7 @@ server: # Disable verification to test locally. # Don't do this in production. insecure_skip_verify: true - # For more TLS settings see config/configtls.TLSClientSetting + # For more TLS settings see config/configtls.ClientConfig capabilities: reports_effective_config: true diff --git a/cmd/opampsupervisor/supervisor/config/config.go b/cmd/opampsupervisor/supervisor/config/config.go index ccbd523d4e6f..7d5000574231 100644 --- a/cmd/opampsupervisor/supervisor/config/config.go +++ b/cmd/opampsupervisor/supervisor/config/config.go @@ -25,7 +25,7 @@ type Capabilities struct { type OpAMPServer struct { Endpoint string - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` } type Agent struct { diff --git a/exporter/alertmanagerexporter/alertmanager_exporter_test.go b/exporter/alertmanagerexporter/alertmanager_exporter_test.go index 438c44824fe7..382e541fa716 100644 --- a/exporter/alertmanagerexporter/alertmanager_exporter_test.go +++ b/exporter/alertmanagerexporter/alertmanager_exporter_test.go @@ -347,7 +347,7 @@ func TestClientConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -370,8 +370,8 @@ func TestClientConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "testdata/test_cert.pem", }, }, @@ -383,8 +383,8 @@ func TestClientConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, diff --git a/exporter/alertmanagerexporter/config_test.go b/exporter/alertmanagerexporter/config_test.go index 41a3acda1b42..3583349ac1df 100644 --- a/exporter/alertmanagerexporter/config_test.go +++ b/exporter/alertmanagerexporter/config_test.go @@ -69,8 +69,8 @@ func TestLoadConfig(t *testing.T) { "another": "somevalue", }, Endpoint: "a.new.alertmanager.target:9093", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", }, }, diff --git a/exporter/coralogixexporter/config_test.go b/exporter/coralogixexporter/config_test.go index e3ccf3a154c5..4ea81bbefefd 100644 --- a/exporter/coralogixexporter/config_test.go +++ b/exporter/coralogixexporter/config_test.go @@ -60,8 +60,8 @@ func TestLoadConfig(t *testing.T) { Traces: configgrpc.ClientConfig{ Endpoint: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", Compression: configcompression.TypeGzip, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", @@ -73,8 +73,8 @@ func TestLoadConfig(t *testing.T) { }, ClientConfig: configgrpc.ClientConfig{ Endpoint: "https://", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", @@ -115,8 +115,8 @@ func TestLoadConfig(t *testing.T) { Traces: configgrpc.ClientConfig{ Endpoint: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", Compression: configcompression.TypeGzip, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", @@ -130,8 +130,8 @@ func TestLoadConfig(t *testing.T) { SubSystemAttributes: []string{"service.name", "k8s.deployment.name", "k8s.statefulset.name", "k8s.daemonset.name", "k8s.cronjob.name", "k8s.job.name", "k8s.container.name"}, ClientConfig: configgrpc.ClientConfig{ Endpoint: "https://", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", diff --git a/exporter/coralogixexporter/factory_test.go b/exporter/coralogixexporter/factory_test.go index 9c98356722fd..bbac7634c6d4 100644 --- a/exporter/coralogixexporter/factory_test.go +++ b/exporter/coralogixexporter/factory_test.go @@ -92,7 +92,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ Traces: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -172,8 +172,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ Traces: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, @@ -186,7 +186,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ Domain: "localhost", DomainSettings: configgrpc.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, diff --git a/exporter/dynatraceexporter/metrics_exporter_test.go b/exporter/dynatraceexporter/metrics_exporter_test.go index ae31e474dce4..0e095b6c6796 100644 --- a/exporter/dynatraceexporter/metrics_exporter_test.go +++ b/exporter/dynatraceexporter/metrics_exporter_test.go @@ -689,8 +689,8 @@ func Test_exporter_start_InvalidClientConfig(t *testing.T) { cfg := &config.Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:9090", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/exporter/elasticsearchexporter/config.go b/exporter/elasticsearchexporter/config.go index b30f486c4116..63dfe75dde89 100644 --- a/exporter/elasticsearchexporter/config.go +++ b/exporter/elasticsearchexporter/config.go @@ -90,7 +90,7 @@ type ClientConfig struct { // will be send with each HTTP request. Headers map[string]string `mapstructure:"headers,omitempty"` - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + configtls.ClientConfig `mapstructure:"tls,omitempty"` } // AuthenticationSettings defines user authentication related settings. diff --git a/exporter/elasticsearchexporter/elasticsearch_bulk.go b/exporter/elasticsearchexporter/elasticsearch_bulk.go index b0ad977cd1a6..9885b70a4127 100644 --- a/exporter/elasticsearchexporter/elasticsearch_bulk.go +++ b/exporter/elasticsearchexporter/elasticsearch_bulk.go @@ -65,7 +65,7 @@ func (*clientLogger) ResponseBodyEnabled() bool { } func newElasticsearchClient(logger *zap.Logger, config *Config) (*esClientCurrent, error) { - tlsCfg, err := config.TLSClientSetting.LoadTLSConfig() + tlsCfg, err := config.ClientConfig.LoadTLSConfig() if err != nil { return nil, err } diff --git a/exporter/instanaexporter/config_test.go b/exporter/instanaexporter/config_test.go index fa05153942b6..207b2fe2daa9 100644 --- a/exporter/instanaexporter/config_test.go +++ b/exporter/instanaexporter/config_test.go @@ -29,8 +29,8 @@ func TestConfigValidate(t *testing.T) { t.Run("Valid configuration with ca_file", func(t *testing.T) { c := &Config{Endpoint: "https://example.com/", AgentKey: "key1", ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.crt", }, }, diff --git a/exporter/instanaexporter/exporter_test.go b/exporter/instanaexporter/exporter_test.go index d81a7711202f..6c7319e28ecf 100644 --- a/exporter/instanaexporter/exporter_test.go +++ b/exporter/instanaexporter/exporter_test.go @@ -84,8 +84,8 @@ func TestSelfSignedBackend(t *testing.T) { AgentKey: "key11", ClientConfig: confighttp.ClientConfig{ Endpoint: server.URL, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: caFile, }, }, @@ -110,8 +110,8 @@ func TestSelfSignedBackendCAFileNotFound(t *testing.T) { AgentKey: "key11", ClientConfig: confighttp.ClientConfig{ Endpoint: "", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca_file_not_found.pem", }, }, diff --git a/exporter/instanaexporter/factory_test.go b/exporter/instanaexporter/factory_test.go index 63643b76f855..4a9d867c9701 100644 --- a/exporter/instanaexporter/factory_test.go +++ b/exporter/instanaexporter/factory_test.go @@ -79,8 +79,8 @@ func TestLoadConfig(t *testing.T) { Timeout: 30 * time.Second, Headers: map[string]configopaque.String{}, WriteBufferSize: 512 * 1024, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.crt", }, }, diff --git a/exporter/kafkaexporter/kafka_exporter_test.go b/exporter/kafkaexporter/kafka_exporter_test.go index ef91f0892d1e..7035bf186905 100644 --- a/exporter/kafkaexporter/kafka_exporter_test.go +++ b/exporter/kafkaexporter/kafka_exporter_test.go @@ -87,8 +87,8 @@ func TestNewExporter_err_auth_type(t *testing.T) { c := Config{ ProtocolVersion: "2.0.0", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/doesnotexist", }, }, diff --git a/exporter/lokiexporter/config_test.go b/exporter/lokiexporter/config_test.go index bd0078f5ca5a..901b73ef817b 100644 --- a/exporter/lokiexporter/config_test.go +++ b/exporter/lokiexporter/config_test.go @@ -41,8 +41,8 @@ func TestLoadConfigNewExporter(t *testing.T) { "X-Custom-Header": "loki_rocks", }, Endpoint: "https://loki:3100/loki/api/v1/push", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", CertFile: "certfile", KeyFile: "keyfile", diff --git a/exporter/opencensusexporter/config_test.go b/exporter/opencensusexporter/config_test.go index 5e80135b8291..1cd3b1a8b9bd 100644 --- a/exporter/opencensusexporter/config_test.go +++ b/exporter/opencensusexporter/config_test.go @@ -57,8 +57,8 @@ func TestLoadConfig(t *testing.T) { }, Endpoint: "1.2.3.4:1234", Compression: "gzip", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", }, Insecure: false, diff --git a/exporter/opencensusexporter/factory_test.go b/exporter/opencensusexporter/factory_test.go index 54f8409442e2..4ff456c9fbd8 100644 --- a/exporter/opencensusexporter/factory_test.go +++ b/exporter/opencensusexporter/factory_test.go @@ -49,7 +49,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -62,7 +62,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -123,8 +123,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "testdata/test_cert.pem", }, }, @@ -137,8 +137,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, diff --git a/exporter/opencensusexporter/opencensus_test.go b/exporter/opencensusexporter/opencensus_test.go index 947c632bbb95..5bc8001ef255 100644 --- a/exporter/opencensusexporter/opencensus_test.go +++ b/exporter/opencensusexporter/opencensus_test.go @@ -41,7 +41,7 @@ func TestSendTraces(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -83,7 +83,7 @@ func TestSendTraces_NoBackend(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: "localhost:56569", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -107,7 +107,7 @@ func TestSendTraces_AfterStop(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: "localhost:56569", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -140,7 +140,7 @@ func TestSendMetrics(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -180,7 +180,7 @@ func TestSendMetrics_NoBackend(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: "localhost:56569", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -204,7 +204,7 @@ func TestSendMetrics_AfterStop(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: "localhost:56569", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } diff --git a/exporter/otelarrowexporter/config_test.go b/exporter/otelarrowexporter/config_test.go index 9f4d83ea5ef7..057e2137fefb 100644 --- a/exporter/otelarrowexporter/config_test.go +++ b/exporter/otelarrowexporter/config_test.go @@ -66,8 +66,8 @@ func TestUnmarshalConfig(t *testing.T) { }, Endpoint: "1.2.3.4:1234", Compression: "none", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", }, Insecure: false, diff --git a/exporter/otelarrowexporter/factory_test.go b/exporter/otelarrowexporter/factory_test.go index 1aa923384d6a..3c827d6b4ef4 100644 --- a/exporter/otelarrowexporter/factory_test.go +++ b/exporter/otelarrowexporter/factory_test.go @@ -77,7 +77,7 @@ func TestCreateTracesExporter(t *testing.T) { config: Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -157,8 +157,8 @@ func TestCreateTracesExporter(t *testing.T) { config: Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: filepath.Join("testdata", "test_cert.pem"), }, }, @@ -170,8 +170,8 @@ func TestCreateTracesExporter(t *testing.T) { config: Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, diff --git a/exporter/prometheusexporter/config_test.go b/exporter/prometheusexporter/config_test.go index 833a1a123776..d0eaf69d7fc9 100644 --- a/exporter/prometheusexporter/config_test.go +++ b/exporter/prometheusexporter/config_test.go @@ -37,8 +37,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "1.2.3.4:1234", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "certs/server.crt", KeyFile: "certs/server.key", CAFile: "certs/ca.crt", diff --git a/exporter/prometheusexporter/prometheus_test.go b/exporter/prometheusexporter/prometheus_test.go index 763f3a34fef2..ccec75923914 100644 --- a/exporter/prometheusexporter/prometheus_test.go +++ b/exporter/prometheusexporter/prometheus_test.go @@ -98,8 +98,8 @@ func TestPrometheusExporter_WithTLS(t *testing.T) { }, ServerConfig: confighttp.ServerConfig{ Endpoint: "localhost:7777", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/certs/server.crt", KeyFile: "./testdata/certs/server.key", CAFile: "./testdata/certs/ca.crt", @@ -117,8 +117,8 @@ func TestPrometheusExporter_WithTLS(t *testing.T) { exp, err := factory.CreateMetricsExporter(context.Background(), set, cfg) require.NoError(t, err) - tlscs := configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlscs := configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.crt", CertFile: "./testdata/certs/client.crt", KeyFile: "./testdata/certs/client.key", diff --git a/exporter/prometheusremotewriteexporter/config_test.go b/exporter/prometheusremotewriteexporter/config_test.go index 8b6b7345fe77..690acbc25462 100644 --- a/exporter/prometheusremotewriteexporter/config_test.go +++ b/exporter/prometheusremotewriteexporter/config_test.go @@ -61,8 +61,8 @@ func TestLoadConfig(t *testing.T) { ExternalLabels: map[string]string{"key1": "value1", "key2": "value2"}, ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:8888", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", // This is subject to change, but currently I have no idea what else to put here lol }, Insecure: false, diff --git a/exporter/prometheusremotewriteexporter/exporter_test.go b/exporter/prometheusremotewriteexporter/exporter_test.go index ef2f0f195c14..cec87c5b0def 100644 --- a/exporter/prometheusremotewriteexporter/exporter_test.go +++ b/exporter/prometheusremotewriteexporter/exporter_test.go @@ -180,8 +180,8 @@ func Test_Start(t *testing.T) { returnErrorOnStartUp: true, clientSettings: confighttp.ClientConfig{ Endpoint: "https://some.url:9411/api/prom/push", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "non-existent file", CertFile: "", KeyFile: "", diff --git a/exporter/prometheusremotewriteexporter/factory_test.go b/exporter/prometheusremotewriteexporter/factory_test.go index ea3be196bac5..ed86ed403a60 100644 --- a/exporter/prometheusremotewriteexporter/factory_test.go +++ b/exporter/prometheusremotewriteexporter/factory_test.go @@ -29,8 +29,8 @@ func Test_createMetricsExporter(t *testing.T) { invalidConfig := createDefaultConfig().(*Config) invalidConfig.ClientConfig = confighttp.ClientConfig{} invalidTLSConfig := createDefaultConfig().(*Config) - invalidTLSConfig.ClientConfig.TLSSetting = configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + invalidTLSConfig.ClientConfig.TLSSetting = configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "non-existent file", CertFile: "", KeyFile: "", diff --git a/exporter/signalfxexporter/config.go b/exporter/signalfxexporter/config.go index aed4f7c82d9a..d7b27608c9b2 100644 --- a/exporter/signalfxexporter/config.go +++ b/exporter/signalfxexporter/config.go @@ -68,7 +68,7 @@ type Config struct { // ingest_tls needs to be set if the exporter's IngestURL is pointing to a signalfx receiver // with TLS enabled and using a self-signed certificate where its CA is not loaded in the system cert pool. - IngestTLSSettings configtls.TLSClientSetting `mapstructure:"ingest_tls,omitempty"` + IngestTLSSettings configtls.ClientConfig `mapstructure:"ingest_tls,omitempty"` // APIURL is the destination to where SignalFx metadata will be sent. This // value takes precedence over the value of Realm @@ -76,7 +76,7 @@ type Config struct { // api_tls needs to be set if the exporter's APIURL is pointing to a httforwarder extension // with TLS enabled and using a self-signed certificate where its CA is not loaded in the system cert pool. - APITLSSettings configtls.TLSClientSetting `mapstructure:"api_tls,omitempty"` + APITLSSettings configtls.ClientConfig `mapstructure:"api_tls,omitempty"` // Whether to log datapoints dispatched to Splunk Observability Cloud LogDataPoints bool `mapstructure:"log_data_points"` diff --git a/exporter/signalfxexporter/exporter_test.go b/exporter/signalfxexporter/exporter_test.go index 1aee96407471..b5203af95ed6 100644 --- a/exporter/signalfxexporter/exporter_test.go +++ b/exporter/signalfxexporter/exporter_test.go @@ -1277,13 +1277,13 @@ func TestTLSExporterInit(t *testing.T) { config: &Config{ APIURL: "https://test", IngestURL: "https://test", - IngestTLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + IngestTLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.pem", }, }, - APITLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + APITLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.pem", }, }, @@ -1297,8 +1297,8 @@ func TestTLSExporterInit(t *testing.T) { config: &Config{ APIURL: "https://test", IngestURL: "https://test", - IngestTLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + IngestTLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/missingfile", }, }, @@ -1313,8 +1313,8 @@ func TestTLSExporterInit(t *testing.T) { config: &Config{ APIURL: "https://test", IngestURL: "https://test", - IngestTLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + IngestTLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/invalid-ca.pem", }, }, @@ -1384,8 +1384,8 @@ func TestTLSIngestConnection(t *testing.T) { config: &Config{ APIURL: serverURL, IngestURL: serverURL, - IngestTLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + IngestTLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.pem", }, }, @@ -1497,8 +1497,8 @@ func TestTLSAPIConnection(t *testing.T) { IngestURL: server.URL, AccessToken: "random", SyncHostMetadata: true, - APITLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + APITLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.pem", }, }, diff --git a/exporter/signalfxexporter/internal/correlation/correlation_test.go b/exporter/signalfxexporter/internal/correlation/correlation_test.go index d1e9db2f7c03..27633dcb2d1b 100644 --- a/exporter/signalfxexporter/internal/correlation/correlation_test.go +++ b/exporter/signalfxexporter/internal/correlation/correlation_test.go @@ -56,8 +56,8 @@ func TestTrackerStart(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:9090", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/exporter/skywalkingexporter/config_test.go b/exporter/skywalkingexporter/config_test.go index 3f53ff4356bc..c86f14588567 100644 --- a/exporter/skywalkingexporter/config_test.go +++ b/exporter/skywalkingexporter/config_test.go @@ -66,8 +66,8 @@ func TestLoadConfig(t *testing.T) { }, Endpoint: "1.2.3.4:11800", Compression: "gzip", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", }, Insecure: false, diff --git a/exporter/skywalkingexporter/factory_test.go b/exporter/skywalkingexporter/factory_test.go index e5f5880e3015..37b732f71040 100644 --- a/exporter/skywalkingexporter/factory_test.go +++ b/exporter/skywalkingexporter/factory_test.go @@ -39,7 +39,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -100,8 +100,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "testdata/test_cert.pem", }, Insecure: false, @@ -115,8 +115,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, diff --git a/exporter/skywalkingexporter/skywalking_benchmark_test.go b/exporter/skywalkingexporter/skywalking_benchmark_test.go index a62aff28ffbf..4a232bbb19ad 100644 --- a/exporter/skywalkingexporter/skywalking_benchmark_test.go +++ b/exporter/skywalkingexporter/skywalking_benchmark_test.go @@ -128,7 +128,7 @@ func doInit(numStream int, t *testing.T) (*swExporter, *grpc.Server, *mockLogHan }, ClientConfig: configgrpc.ClientConfig{ Endpoint: addr.String(), - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/exporter/skywalkingexporter/skywalking_test.go b/exporter/skywalkingexporter/skywalking_test.go index cebb52485bb0..e75c957b621c 100644 --- a/exporter/skywalkingexporter/skywalking_test.go +++ b/exporter/skywalkingexporter/skywalking_test.go @@ -33,7 +33,7 @@ func TestSwExporter(t *testing.T) { NumStreams: 10, ClientConfig: configgrpc.ClientConfig{ Endpoint: addr.String(), - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -106,7 +106,7 @@ func TestSwExporter(t *testing.T) { NumStreams: 10, ClientConfig: configgrpc.ClientConfig{ Endpoint: addr.String(), - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/exporter/splunkhecexporter/config_test.go b/exporter/splunkhecexporter/config_test.go index dd6c4c689581..023b3eed3a6e 100644 --- a/exporter/splunkhecexporter/config_test.go +++ b/exporter/splunkhecexporter/config_test.go @@ -63,8 +63,8 @@ func TestLoadConfig(t *testing.T) { ClientConfig: confighttp.ClientConfig{ Timeout: 10 * time.Second, Endpoint: "https://splunk:8088/services/collector", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "", CertFile: "", KeyFile: "", diff --git a/exporter/syslogexporter/config.go b/exporter/syslogexporter/config.go index c5f0c9c3d767..31f0c0c4bfc1 100644 --- a/exporter/syslogexporter/config.go +++ b/exporter/syslogexporter/config.go @@ -38,7 +38,7 @@ type Config struct { EnableOctetCounting bool `mapstructure:"enable_octet_counting"` // TLSSetting struct exposes TLS client configuration. - TLSSetting configtls.TLSClientSetting `mapstructure:"tls"` + TLSSetting configtls.ClientConfig `mapstructure:"tls"` exporterhelper.QueueSettings `mapstructure:"sending_queue"` configretry.BackOffConfig `mapstructure:"retry_on_failure"` diff --git a/exporter/syslogexporter/exporter_test.go b/exporter/syslogexporter/exporter_test.go index 58a025701b3a..189e89e73f40 100644 --- a/exporter/syslogexporter/exporter_test.go +++ b/exporter/syslogexporter/exporter_test.go @@ -191,27 +191,27 @@ func TestTLSConfig(t *testing.T) { tests := []struct { name string network string - tlsSettings configtls.TLSClientSetting + tlsSettings configtls.ClientConfig tlsConfig *tls.Config }{ {name: "TCP with TLS configuration", network: "tcp", - tlsSettings: configtls.TLSClientSetting{}, + tlsSettings: configtls.ClientConfig{}, tlsConfig: &tls.Config{}, }, {name: "TCP insecure", network: "tcp", - tlsSettings: configtls.TLSClientSetting{Insecure: true}, + tlsSettings: configtls.ClientConfig{Insecure: true}, tlsConfig: nil, }, {name: "UDP with TLS configuration", network: "udp", - tlsSettings: configtls.TLSClientSetting{}, + tlsSettings: configtls.ClientConfig{}, tlsConfig: nil, }, {name: "UDP insecure", network: "udp", - tlsSettings: configtls.TLSClientSetting{Insecure: true}, + tlsSettings: configtls.ClientConfig{Insecure: true}, tlsConfig: nil, }, } diff --git a/exporter/zipkinexporter/config_test.go b/exporter/zipkinexporter/config_test.go index cd317d160568..db89e0619f7a 100644 --- a/exporter/zipkinexporter/config_test.go +++ b/exporter/zipkinexporter/config_test.go @@ -61,7 +61,7 @@ func TestLoadConfig(t *testing.T) { Endpoint: "https://somedest:1234/api/v2/spans", WriteBufferSize: 524288, Timeout: 5 * time.Second, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ InsecureSkipVerify: true, }, MaxIdleConns: &maxIdleConns, diff --git a/extension/awsproxy/config_test.go b/extension/awsproxy/config_test.go index 4834342dfa2c..a6171a652990 100644 --- a/extension/awsproxy/config_test.go +++ b/extension/awsproxy/config_test.go @@ -37,7 +37,7 @@ func TestLoadConfig(t *testing.T) { Endpoint: "0.0.0.0:1234", }, ProxyAddress: "https://proxy.proxy.com", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, ServerName: "something", }, diff --git a/extension/awsproxy/factory.go b/extension/awsproxy/factory.go index b371d643b4c0..9c56133faceb 100644 --- a/extension/awsproxy/factory.go +++ b/extension/awsproxy/factory.go @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { TCPAddrConfig: confignet.TCPAddrConfig{ Endpoint: localhostgate.EndpointForPort(defaultPort), }, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, diff --git a/extension/healthcheckextension/config_test.go b/extension/healthcheckextension/config_test.go index 16729c019b64..43dc962b1ae7 100644 --- a/extension/healthcheckextension/config_test.go +++ b/extension/healthcheckextension/config_test.go @@ -34,8 +34,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "localhost:13", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CAFile: "/path/to/ca", CertFile: "/path/to/cert", KeyFile: "/path/to/key", diff --git a/extension/httpforwarderextension/extension_test.go b/extension/httpforwarderextension/extension_test.go index 352fe7b331dd..3a9747857d34 100644 --- a/extension/httpforwarderextension/extension_test.go +++ b/extension/httpforwarderextension/extension_test.go @@ -132,8 +132,8 @@ func TestExtension(t *testing.T) { config: &Config{ Egress: confighttp.ClientConfig{ Endpoint: "localhost:9090", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/extension/jaegerremotesampling/extension_test.go b/extension/jaegerremotesampling/extension_test.go index 53be6b87d7d8..072b45268e76 100644 --- a/extension/jaegerremotesampling/extension_test.go +++ b/extension/jaegerremotesampling/extension_test.go @@ -102,7 +102,7 @@ func TestRemote(t *testing.T) { cfg.Source.ReloadInterval = tc.reloadInterval cfg.Source.Remote = &configgrpc.ClientConfig{ Endpoint: fmt.Sprintf("127.0.0.1:%d", lis.Addr().(*net.TCPAddr).Port), - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, // test only }, WaitForReady: true, diff --git a/extension/oauth2clientauthextension/config.go b/extension/oauth2clientauthextension/config.go index c5e31064070a..ea99916f4d73 100644 --- a/extension/oauth2clientauthextension/config.go +++ b/extension/oauth2clientauthextension/config.go @@ -49,7 +49,7 @@ type Config struct { Scopes []string `mapstructure:"scopes,omitempty"` // TLSSetting struct exposes TLS client configuration for the underneath client to authorization server. - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` // Timeout parameter configures `http.Client.Timeout` for the underneath client to authorization // server while fetching and refreshing tokens. diff --git a/extension/oauth2clientauthextension/config_test.go b/extension/oauth2clientauthextension/config_test.go index 288b4340c567..10fae26ecaf7 100644 --- a/extension/oauth2clientauthextension/config_test.go +++ b/extension/oauth2clientauthextension/config_test.go @@ -45,8 +45,8 @@ func TestLoadConfig(t *testing.T) { Scopes: []string{"api.metrics"}, TokenURL: "https://example2.com/oauth2/default/v1/token", Timeout: time.Second, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "cafile", CertFile: "certfile", KeyFile: "keyfile", diff --git a/extension/oauth2clientauthextension/extension_test.go b/extension/oauth2clientauthextension/extension_test.go index 2e68687aeafd..bfc0886cbf77 100644 --- a/extension/oauth2clientauthextension/extension_test.go +++ b/extension/oauth2clientauthextension/extension_test.go @@ -43,8 +43,8 @@ func TestOAuthClientSettings(t *testing.T) { TokenURL: "https://example.com/v1/token", Scopes: []string{"resource.read"}, Timeout: 2, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: testCAFile, CertFile: testCertFile, KeyFile: testKeyFile, @@ -64,8 +64,8 @@ func TestOAuthClientSettings(t *testing.T) { TokenURL: "https://example.com/v1/token", Scopes: []string{"resource.read"}, Timeout: 2, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: testCAFile, CertFile: "doestexist.cert", KeyFile: testKeyFile, diff --git a/extension/opampextension/config.go b/extension/opampextension/config.go index 0ed2bb11e4a1..7756b1e1164a 100644 --- a/extension/opampextension/config.go +++ b/extension/opampextension/config.go @@ -46,7 +46,7 @@ func (caps Capabilities) toAgentCapabilities() protobufs.AgentCapabilities { type commonFields struct { Endpoint string `mapstructure:"endpoint"` - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` Headers map[string]configopaque.String `mapstructure:"headers,omitempty"` } @@ -87,13 +87,13 @@ func (s OpAMPServer) GetHeaders() map[string]configopaque.String { return map[string]configopaque.String{} } -func (s OpAMPServer) GetTLSSetting() configtls.TLSClientSetting { +func (s OpAMPServer) GetTLSSetting() configtls.ClientConfig { if s.WS != nil { return s.WS.TLSSetting } else if s.HTTP != nil { return s.HTTP.TLSSetting } - return configtls.TLSClientSetting{} + return configtls.ClientConfig{} } func (s OpAMPServer) GetEndpoint() string { diff --git a/extension/opampextension/config_test.go b/extension/opampextension/config_test.go index 364f1236f1e5..7a0d0ddd4461 100644 --- a/extension/opampextension/config_test.go +++ b/extension/opampextension/config_test.go @@ -97,7 +97,7 @@ func TestConfig_Getters(t *testing.T) { Headers: map[string]configopaque.String{ "test": configopaque.String("test"), }, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -118,7 +118,7 @@ func TestConfig_Getters(t *testing.T) { Headers: map[string]configopaque.String{ "test": configopaque.String("test"), }, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/internal/aws/proxy/cfg.go b/internal/aws/proxy/cfg.go index 4a20b817b4a9..2d352d58f742 100644 --- a/internal/aws/proxy/cfg.go +++ b/internal/aws/proxy/cfg.go @@ -23,7 +23,7 @@ type Config struct { // TLSSetting struct exposes TLS client configuration when forwarding // calls to the AWS X-Ray backend. - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` // Region is the AWS region the local TCP server forwards requests to. Region string `mapstructure:"region"` @@ -52,7 +52,7 @@ func DefaultConfig() *Config { Endpoint: localhostgate.EndpointForPort(2000), }, ProxyAddress: "", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, ServerName: "", }, diff --git a/internal/kafka/authentication.go b/internal/kafka/authentication.go index 835244fc10dc..a05edc6486c5 100644 --- a/internal/kafka/authentication.go +++ b/internal/kafka/authentication.go @@ -16,10 +16,10 @@ import ( // Authentication defines authentication. type Authentication struct { - PlainText *PlainTextConfig `mapstructure:"plain_text"` - SASL *SASLConfig `mapstructure:"sasl"` - TLS *configtls.TLSClientSetting `mapstructure:"tls"` - Kerberos *KerberosConfig `mapstructure:"kerberos"` + PlainText *PlainTextConfig `mapstructure:"plain_text"` + SASL *SASLConfig `mapstructure:"sasl"` + TLS *configtls.ClientConfig `mapstructure:"tls"` + Kerberos *KerberosConfig `mapstructure:"kerberos"` } // PlainTextConfig defines plaintext authentication. @@ -134,7 +134,7 @@ func configureSASL(config SASLConfig, saramaConfig *sarama.Config) error { return nil } -func configureTLS(config configtls.TLSClientSetting, saramaConfig *sarama.Config) error { +func configureTLS(config configtls.ClientConfig, saramaConfig *sarama.Config) error { tlsConfig, err := config.LoadTLSConfig() if err != nil { return fmt.Errorf("error loading tls config: %w", err) diff --git a/internal/kafka/authentication_test.go b/internal/kafka/authentication_test.go index 071a7ec8bf18..3fa52c62ea33 100644 --- a/internal/kafka/authentication_test.go +++ b/internal/kafka/authentication_test.go @@ -46,7 +46,7 @@ func TestAuthentication(t *testing.T) { saramaTLSCfg := &sarama.Config{} saramaTLSCfg.Net.TLS.Enable = true - tlsClient := configtls.TLSClientSetting{} + tlsClient := configtls.ClientConfig{} tlscfg, err := tlsClient.LoadTLSConfig() require.NoError(t, err) saramaTLSCfg.Net.TLS.Config = tlscfg @@ -73,12 +73,12 @@ func TestAuthentication(t *testing.T) { saramaConfig: saramaPlaintext, }, { - auth: Authentication{TLS: &configtls.TLSClientSetting{}}, + auth: Authentication{TLS: &configtls.ClientConfig{}}, saramaConfig: saramaTLSCfg, }, { - auth: Authentication{TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{CAFile: "/doesnotexists"}, + auth: Authentication{TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{CAFile: "/doesnotexists"}, }}, saramaConfig: saramaTLSCfg, err: "failed to load TLS config", diff --git a/internal/kubelet/client_config.go b/internal/kubelet/client_config.go index ff8c86f2c8cb..91eb85267d68 100644 --- a/internal/kubelet/client_config.go +++ b/internal/kubelet/client_config.go @@ -11,8 +11,8 @@ import ( // ClientConfig for a kubelet client for talking to a kubelet HTTP endpoint. type ClientConfig struct { - k8sconfig.APIConfig `mapstructure:",squash"` - configtls.TLSSetting `mapstructure:",squash"` + k8sconfig.APIConfig `mapstructure:",squash"` + configtls.Config `mapstructure:",squash"` // InsecureSkipVerify controls whether the client verifies the server's // certificate chain and host name. InsecureSkipVerify bool `mapstructure:"insecure_skip_verify"` diff --git a/internal/kubelet/client_test.go b/internal/kubelet/client_test.go index cdc0c10ed457..7efd087206d7 100644 --- a/internal/kubelet/client_test.go +++ b/internal/kubelet/client_test.go @@ -55,7 +55,7 @@ func TestNewTLSClientProvider(t *testing.T) { APIConfig: k8sconfig.APIConfig{ AuthType: k8sconfig.AuthTypeTLS, }, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: certPath, CertFile: certPath, KeyFile: keyFile, @@ -278,7 +278,7 @@ func TestTLSMissingCertFile(t *testing.T) { p := tlsClientProvider{ endpoint: "", cfg: &ClientConfig{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: certPath, }, }, diff --git a/pkg/stanza/operator/input/syslog/config_test.go b/pkg/stanza/operator/input/syslog/config_test.go index fc8354440db0..3285fb793ca2 100644 --- a/pkg/stanza/operator/input/syslog/config_test.go +++ b/pkg/stanza/operator/input/syslog/config_test.go @@ -39,8 +39,8 @@ func TestUnmarshal(t *testing.T) { cfg.TCP.Encoding = "utf-16" cfg.TCP.SplitConfig.LineStartPattern = "ABC" cfg.TCP.SplitConfig.LineEndPattern = "" - cfg.TCP.TLS = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.TCP.TLS = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "foo", KeyFile: "foo2", CAFile: "foo3", diff --git a/pkg/stanza/operator/input/tcp/config_test.go b/pkg/stanza/operator/input/tcp/config_test.go index 07e7f9305bf6..e760df6018ca 100644 --- a/pkg/stanza/operator/input/tcp/config_test.go +++ b/pkg/stanza/operator/input/tcp/config_test.go @@ -32,8 +32,8 @@ func TestUnmarshal(t *testing.T) { cfg.AddAttributes = true cfg.Encoding = "utf-8" cfg.SplitConfig.LineStartPattern = "ABC" - cfg.TLS = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.TLS = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "foo", KeyFile: "foo2", CAFile: "foo3", diff --git a/pkg/stanza/operator/input/tcp/tcp.go b/pkg/stanza/operator/input/tcp/tcp.go index 2dd553e77512..e28853cbd287 100644 --- a/pkg/stanza/operator/input/tcp/tcp.go +++ b/pkg/stanza/operator/input/tcp/tcp.go @@ -68,14 +68,14 @@ type Config struct { // BaseConfig is the detailed configuration of a tcp input operator. type BaseConfig struct { - MaxLogSize helper.ByteSize `mapstructure:"max_log_size,omitempty"` - ListenAddress string `mapstructure:"listen_address,omitempty"` - TLS *configtls.TLSServerSetting `mapstructure:"tls,omitempty"` - AddAttributes bool `mapstructure:"add_attributes,omitempty"` - OneLogPerPacket bool `mapstructure:"one_log_per_packet,omitempty"` - Encoding string `mapstructure:"encoding,omitempty"` - SplitConfig split.Config `mapstructure:"multiline,omitempty"` - TrimConfig trim.Config `mapstructure:",squash"` + MaxLogSize helper.ByteSize `mapstructure:"max_log_size,omitempty"` + ListenAddress string `mapstructure:"listen_address,omitempty"` + TLS *configtls.ServerConfig `mapstructure:"tls,omitempty"` + AddAttributes bool `mapstructure:"add_attributes,omitempty"` + OneLogPerPacket bool `mapstructure:"one_log_per_packet,omitempty"` + Encoding string `mapstructure:"encoding,omitempty"` + SplitConfig split.Config `mapstructure:"multiline,omitempty"` + TrimConfig trim.Config `mapstructure:",squash"` SplitFuncBuilder SplitFuncBuilder } diff --git a/pkg/stanza/operator/input/tcp/tcp_test.go b/pkg/stanza/operator/input/tcp/tcp_test.go index 3bb3c0cbe4be..c08eb4545cfc 100644 --- a/pkg/stanza/operator/input/tcp/tcp_test.go +++ b/pkg/stanza/operator/input/tcp/tcp_test.go @@ -206,8 +206,8 @@ func tlsInputTest(input []byte, expected []string) func(t *testing.T) { cfg := NewConfigWithID("test_id") cfg.ListenAddress = ":0" - cfg.TLS = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.TLS = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "test.crt", KeyFile: "test.key", }, @@ -325,8 +325,8 @@ func TestBuild(t *testing.T) { BaseConfig: BaseConfig{ MaxLogSize: 65536, ListenAddress: "10.0.0.1:9000", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/tmp/cert/missing", KeyFile: "/tmp/key/missing", }, diff --git a/processor/resourcedetectionprocessor/config_test.go b/processor/resourcedetectionprocessor/config_test.go index 829e3f6accf9..20ba6b7e7c6d 100644 --- a/processor/resourcedetectionprocessor/config_test.go +++ b/processor/resourcedetectionprocessor/config_test.go @@ -33,7 +33,7 @@ func TestLoadConfig(t *testing.T) { openshiftConfig.OpenShiftConfig = openshift.Config{ Address: "127.0.0.1:4444", Token: "some_token", - TLSSettings: configtls.TLSClientSetting{ + TLSSettings: configtls.ClientConfig{ Insecure: true, }, ResourceAttributes: openshift.CreateDefaultConfig().ResourceAttributes, diff --git a/processor/resourcedetectionprocessor/internal/openshift/config.go b/processor/resourcedetectionprocessor/internal/openshift/config.go index 57e9a0c56b53..408bcc760984 100644 --- a/processor/resourcedetectionprocessor/internal/openshift/config.go +++ b/processor/resourcedetectionprocessor/internal/openshift/config.go @@ -48,7 +48,7 @@ type Config struct { // TLSSettings contains TLS configurations that are specific to client // connection used to communicate with the Openshift API. - TLSSettings configtls.TLSClientSetting `mapstructure:"tls"` + TLSSettings configtls.ClientConfig `mapstructure:"tls"` ResourceAttributes metadata.ResourceAttributesConfig `mapstructure:"resource_attributes"` } diff --git a/receiver/aerospikereceiver/config.go b/receiver/aerospikereceiver/config.go index 1e8040226f2b..bfdfa157b64d 100644 --- a/receiver/aerospikereceiver/config.go +++ b/receiver/aerospikereceiver/config.go @@ -39,7 +39,7 @@ type Config struct { CollectClusterMetrics bool `mapstructure:"collect_cluster_metrics"` Timeout time.Duration `mapstructure:"timeout"` MetricsBuilderConfig metadata.MetricsBuilderConfig `mapstructure:",squash"` - TLS *configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLS *configtls.ClientConfig `mapstructure:"tls,omitempty"` } // Validate validates the values of the given Config, and returns an error if validation fails diff --git a/receiver/aerospikereceiver/config_test.go b/receiver/aerospikereceiver/config_test.go index 9df9bdb4262b..cc3e2a708b2a 100644 --- a/receiver/aerospikereceiver/config_test.go +++ b/receiver/aerospikereceiver/config_test.go @@ -104,9 +104,9 @@ func TestValidate(t *testing.T) { config: &Config{ Endpoint: "localhost:3000", TLSName: "tls1", - TLS: &configtls.TLSClientSetting{ + TLS: &configtls.ClientConfig{ Insecure: false, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: "BADCAFILE", }, }, @@ -119,9 +119,9 @@ func TestValidate(t *testing.T) { config: &Config{ Endpoint: "localhost:3000", TLSName: "", - TLS: &configtls.TLSClientSetting{ + TLS: &configtls.ClientConfig{ Insecure: false, - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.Config{}, }, ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type), }, diff --git a/receiver/apachereceiver/scraper_test.go b/receiver/apachereceiver/scraper_test.go index ab17716b64f5..0a021c473c02 100644 --- a/receiver/apachereceiver/scraper_test.go +++ b/receiver/apachereceiver/scraper_test.go @@ -58,8 +58,8 @@ func TestScraperFailedStart(t *testing.T) { sc := newApacheScraper(receivertest.NewNopCreateSettings(), &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:8080", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/receiver/awsfirehosereceiver/config_test.go b/receiver/awsfirehosereceiver/config_test.go index 2963f517bc16..951330deb349 100644 --- a/receiver/awsfirehosereceiver/config_test.go +++ b/receiver/awsfirehosereceiver/config_test.go @@ -35,8 +35,8 @@ func TestLoadConfig(t *testing.T) { AccessKey: "some_access_key", ServerConfig: confighttp.ServerConfig{ Endpoint: "0.0.0.0:4433", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "server.crt", KeyFile: "server.key", }, diff --git a/receiver/awsxrayreceiver/config_test.go b/receiver/awsxrayreceiver/config_test.go index c1e6c64e08fa..caef308eef43 100644 --- a/receiver/awsxrayreceiver/config_test.go +++ b/receiver/awsxrayreceiver/config_test.go @@ -44,7 +44,7 @@ func TestLoadConfig(t *testing.T) { Endpoint: "0.0.0.0:2000", }, ProxyAddress: "", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, ServerName: "", }, @@ -67,7 +67,7 @@ func TestLoadConfig(t *testing.T) { Endpoint: "0.0.0.0:1234", }, ProxyAddress: "https://proxy.proxy.com", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, ServerName: "something", }, diff --git a/receiver/bigipreceiver/client_test.go b/receiver/bigipreceiver/client_test.go index 21a117de939a..74ddbe971dfd 100644 --- a/receiver/bigipreceiver/client_test.go +++ b/receiver/bigipreceiver/client_test.go @@ -50,8 +50,8 @@ func TestNewClient(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -66,7 +66,7 @@ func TestNewClient(t *testing.T) { desc: "Valid Configuration", cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/bigipreceiver/scraper_test.go b/receiver/bigipreceiver/scraper_test.go index 066a289c19be..37f3c3f171d7 100644 --- a/receiver/bigipreceiver/scraper_test.go +++ b/receiver/bigipreceiver/scraper_test.go @@ -38,8 +38,8 @@ func TestScraperStart(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -54,7 +54,7 @@ func TestScraperStart(t *testing.T) { scraper: &bigipScraper{ cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/cloudflarereceiver/config.go b/receiver/cloudflarereceiver/config.go index a532da47419c..59ef966c0d75 100644 --- a/receiver/cloudflarereceiver/config.go +++ b/receiver/cloudflarereceiver/config.go @@ -18,11 +18,11 @@ type Config struct { } type LogsConfig struct { - Secret string `mapstructure:"secret"` - Endpoint string `mapstructure:"endpoint"` - TLS *configtls.TLSServerSetting `mapstructure:"tls"` - Attributes map[string]string `mapstructure:"attributes"` - TimestampField string `mapstructure:"timestamp_field"` + Secret string `mapstructure:"secret"` + Endpoint string `mapstructure:"endpoint"` + TLS *configtls.ServerConfig `mapstructure:"tls"` + Attributes map[string]string `mapstructure:"attributes"` + TimestampField string `mapstructure:"timestamp_field"` } var ( diff --git a/receiver/cloudflarereceiver/config_test.go b/receiver/cloudflarereceiver/config_test.go index b5335f7181fa..e541cf92db01 100644 --- a/receiver/cloudflarereceiver/config_test.go +++ b/receiver/cloudflarereceiver/config_test.go @@ -34,8 +34,8 @@ func TestValidate(t *testing.T) { config: Config{ Logs: LogsConfig{ Endpoint: "0.0.0.0:9999", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "some_cert_file", KeyFile: "some_key_file", }, @@ -64,8 +64,8 @@ func TestValidate(t *testing.T) { config: Config{ Logs: LogsConfig{ Endpoint: "0.0.0.0:9999", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "some_cert_file", }, }, @@ -78,8 +78,8 @@ func TestValidate(t *testing.T) { config: Config{ Logs: LogsConfig{ Endpoint: "0.0.0.0:9999", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ KeyFile: "some_key_file", }, }, @@ -114,8 +114,8 @@ func TestLoadConfig(t *testing.T) { expectedConfig: &Config{ Logs: LogsConfig{ Endpoint: "0.0.0.0:12345", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "some_cert_file", KeyFile: "some_key_file", }, diff --git a/receiver/cloudflarereceiver/logs_integration_test.go b/receiver/cloudflarereceiver/logs_integration_test.go index bf95f031f4fd..6a16bf2b3afd 100644 --- a/receiver/cloudflarereceiver/logs_integration_test.go +++ b/receiver/cloudflarereceiver/logs_integration_test.go @@ -56,8 +56,8 @@ func TestReceiverTLS(t *testing.T) { Logs: LogsConfig{ Secret: testSecret, Endpoint: testAddr, - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: filepath.Join("testdata", "cert", "server.crt"), KeyFile: filepath.Join("testdata", "cert", "server.key"), }, diff --git a/receiver/cloudflarereceiver/logs_test.go b/receiver/cloudflarereceiver/logs_test.go index 6a0ac738da63..9df7c91376bd 100644 --- a/receiver/cloudflarereceiver/logs_test.go +++ b/receiver/cloudflarereceiver/logs_test.go @@ -115,7 +115,7 @@ func TestPayloadToLogRecord(t *testing.T) { recv := newReceiver(t, &Config{ Logs: LogsConfig{ Endpoint: "localhost:0", - TLS: &configtls.TLSServerSetting{}, + TLS: &configtls.ServerConfig{}, TimestampField: "EdgeStartTimestamp", Attributes: map[string]string{ "ClientIP": "http_request.client_ip", @@ -310,7 +310,7 @@ func TestHandleRequest(t *testing.T) { Attributes: map[string]string{ "ClientIP": "http_request.client_ip", }, - TLS: &configtls.TLSServerSetting{}, + TLS: &configtls.ServerConfig{}, }, }, consumer, diff --git a/receiver/cloudfoundryreceiver/config_test.go b/receiver/cloudfoundryreceiver/config_test.go index b8083f1da023..110d0d95a6b3 100644 --- a/receiver/cloudfoundryreceiver/config_test.go +++ b/receiver/cloudfoundryreceiver/config_test.go @@ -36,7 +36,7 @@ func TestLoadConfig(t *testing.T) { RLPGateway: RLPGatewayConfig{ ClientConfig: confighttp.ClientConfig{ Endpoint: "https://log-stream.sys.example.internal", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ InsecureSkipVerify: true, }, Timeout: time.Second * 20, @@ -106,7 +106,7 @@ func TestHTTPConfigurationStructConsistency(t *testing.T) { // library does not support. checkTypeFieldMatch(t, "Endpoint", reflect.TypeOf(LimitedClientConfig{}), reflect.TypeOf(confighttp.ClientConfig{})) checkTypeFieldMatch(t, "TLSSetting", reflect.TypeOf(LimitedClientConfig{}), reflect.TypeOf(confighttp.ClientConfig{})) - checkTypeFieldMatch(t, "InsecureSkipVerify", reflect.TypeOf(LimitedTLSClientSetting{}), reflect.TypeOf(configtls.TLSClientSetting{})) + checkTypeFieldMatch(t, "InsecureSkipVerify", reflect.TypeOf(LimitedTLSClientSetting{}), reflect.TypeOf(configtls.ClientConfig{})) } func loadSuccessfulConfig(t *testing.T) *Config { @@ -115,7 +115,7 @@ func loadSuccessfulConfig(t *testing.T) *Config { ClientConfig: confighttp.ClientConfig{ Endpoint: "https://log-stream.sys.example.internal", Timeout: time.Second * 20, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ InsecureSkipVerify: true, }, }, diff --git a/receiver/cloudfoundryreceiver/factory.go b/receiver/cloudfoundryreceiver/factory.go index 38ae50a0c76f..9ce95b4495f5 100644 --- a/receiver/cloudfoundryreceiver/factory.go +++ b/receiver/cloudfoundryreceiver/factory.go @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { RLPGateway: RLPGatewayConfig{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultURL, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ InsecureSkipVerify: false, }, }, diff --git a/receiver/couchdbreceiver/client_test.go b/receiver/couchdbreceiver/client_test.go index 803eec0603ef..15b351102d5d 100644 --- a/receiver/couchdbreceiver/client_test.go +++ b/receiver/couchdbreceiver/client_test.go @@ -35,8 +35,8 @@ func TestNewCouchDBClient(t *testing.T) { &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/receiver/couchdbreceiver/factory.go b/receiver/couchdbreceiver/factory.go index baeebf8359d0..ad04701e2e3c 100644 --- a/receiver/couchdbreceiver/factory.go +++ b/receiver/couchdbreceiver/factory.go @@ -30,7 +30,7 @@ func createDefaultConfig() component.Config { MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type), ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, Timeout: 1 * time.Minute, }, diff --git a/receiver/elasticsearchreceiver/scraper_test.go b/receiver/elasticsearchreceiver/scraper_test.go index 74cad46a4440..6fc74abc73f5 100644 --- a/receiver/elasticsearchreceiver/scraper_test.go +++ b/receiver/elasticsearchreceiver/scraper_test.go @@ -211,8 +211,8 @@ func TestScraperFailedStart(t *testing.T) { conf.ClientConfig = confighttp.ClientConfig{ Endpoint: "localhost:9200", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/receiver/flinkmetricsreceiver/client_test.go b/receiver/flinkmetricsreceiver/client_test.go index 8cb23c2c4c1f..86fcfcbc4b35 100644 --- a/receiver/flinkmetricsreceiver/client_test.go +++ b/receiver/flinkmetricsreceiver/client_test.go @@ -60,8 +60,8 @@ func TestNewClient(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -76,7 +76,7 @@ func TestNewClient(t *testing.T) { desc: "Valid Configuration", cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/flinkmetricsreceiver/scraper_test.go b/receiver/flinkmetricsreceiver/scraper_test.go index ab02aa118d98..fb45281a8a48 100644 --- a/receiver/flinkmetricsreceiver/scraper_test.go +++ b/receiver/flinkmetricsreceiver/scraper_test.go @@ -44,8 +44,8 @@ func TestScraperStart(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -60,7 +60,7 @@ func TestScraperStart(t *testing.T) { scraper: &flinkmetricsScraper{ cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/httpcheckreceiver/scraper_test.go b/receiver/httpcheckreceiver/scraper_test.go index ef0244b98c55..0ceb0df9440e 100644 --- a/receiver/httpcheckreceiver/scraper_test.go +++ b/receiver/httpcheckreceiver/scraper_test.go @@ -45,8 +45,8 @@ func TestScraperStart(t *testing.T) { { ClientConfig: confighttp.ClientConfig{ Endpoint: "http://example.com", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -65,7 +65,7 @@ func TestScraperStart(t *testing.T) { Targets: []*targetConfig{ { ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: "http://example.com", }, }, diff --git a/receiver/jaegerreceiver/config_test.go b/receiver/jaegerreceiver/config_test.go index 39400a80538d..97999b6812b1 100644 --- a/receiver/jaegerreceiver/config_test.go +++ b/receiver/jaegerreceiver/config_test.go @@ -113,8 +113,8 @@ func TestLoadConfig(t *testing.T) { Endpoint: "localhost:9876", Transport: confignet.TransportTypeTCP, }, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/test.crt", KeyFile: "/test.key", }, diff --git a/receiver/jaegerreceiver/factory_test.go b/receiver/jaegerreceiver/factory_test.go index 084bf2865cb2..92c45a910c10 100644 --- a/receiver/jaegerreceiver/factory_test.go +++ b/receiver/jaegerreceiver/factory_test.go @@ -102,8 +102,8 @@ func TestCreateTLSGPRCEndpoint(t *testing.T) { Endpoint: "0.0.0.0:14250", Transport: confignet.TransportTypeTCP, }, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, @@ -121,8 +121,8 @@ func TestCreateTLSThriftHTTPEndpoint(t *testing.T) { cfg.(*Config).Protocols.ThriftHTTP = &confighttp.ServerConfig{ Endpoint: "0.0.0.0:14268", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, diff --git a/receiver/jaegerreceiver/trace_receiver_test.go b/receiver/jaegerreceiver/trace_receiver_test.go index d7eeaf522cae..50de4cb2d787 100644 --- a/receiver/jaegerreceiver/trace_receiver_test.go +++ b/receiver/jaegerreceiver/trace_receiver_test.go @@ -188,8 +188,8 @@ func TestGRPCReception(t *testing.T) { func TestGRPCReceptionWithTLS(t *testing.T) { // prepare - tlsCreds := &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + tlsCreds := &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: filepath.Join("testdata", "server.crt"), KeyFile: filepath.Join("testdata", "server.key"), }, diff --git a/receiver/kafkametricsreceiver/config_test.go b/receiver/kafkametricsreceiver/config_test.go index 4751b3a9a35b..8c25669a1c53 100644 --- a/receiver/kafkametricsreceiver/config_test.go +++ b/receiver/kafkametricsreceiver/config_test.go @@ -35,8 +35,8 @@ func TestLoadConfig(t *testing.T) { TopicMatch: "test_\\w+", GroupMatch: "test_\\w+", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.pem", CertFile: "cert.pem", KeyFile: "key.pem", diff --git a/receiver/kafkametricsreceiver/receiver_test.go b/receiver/kafkametricsreceiver/receiver_test.go index 5a8ac97222c6..27564342ad76 100644 --- a/receiver/kafkametricsreceiver/receiver_test.go +++ b/receiver/kafkametricsreceiver/receiver_test.go @@ -46,8 +46,8 @@ func TestNewReceiver_invalid_scraper_error(t *testing.T) { func TestNewReceiver_invalid_auth_error(t *testing.T) { c := createDefaultConfig().(*Config) c.Authentication = kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/invalid", }, }, diff --git a/receiver/kafkareceiver/config_test.go b/receiver/kafkareceiver/config_test.go index c59f70d92e74..bc0d8d4974d5 100644 --- a/receiver/kafkareceiver/config_test.go +++ b/receiver/kafkareceiver/config_test.go @@ -41,8 +41,8 @@ func TestLoadConfig(t *testing.T) { GroupID: "otel-collector", InitialOffset: "latest", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.pem", CertFile: "cert.pem", KeyFile: "key.pem", @@ -73,8 +73,8 @@ func TestLoadConfig(t *testing.T) { GroupID: "otel-collector", InitialOffset: "earliest", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.pem", CertFile: "cert.pem", KeyFile: "key.pem", diff --git a/receiver/kafkareceiver/kafka_receiver_test.go b/receiver/kafkareceiver/kafka_receiver_test.go index ca4b5f544dc1..25d4dcaa4bca 100644 --- a/receiver/kafkareceiver/kafka_receiver_test.go +++ b/receiver/kafkareceiver/kafka_receiver_test.go @@ -59,8 +59,8 @@ func TestNewTracesReceiver_err_auth_type(t *testing.T) { c := Config{ ProtocolVersion: "2.0.0", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/doesnotexist", }, }, @@ -325,8 +325,8 @@ func TestNewMetricsExporter_err_auth_type(t *testing.T) { c := Config{ ProtocolVersion: "2.0.0", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/doesnotexist", }, }, @@ -580,8 +580,8 @@ func TestNewLogsExporter_err_auth_type(t *testing.T) { c := Config{ ProtocolVersion: "2.0.0", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/doesnotexist", }, }, diff --git a/receiver/kubeletstatsreceiver/config_test.go b/receiver/kubeletstatsreceiver/config_test.go index fe5f055413e1..0b2a10c263f7 100644 --- a/receiver/kubeletstatsreceiver/config_test.go +++ b/receiver/kubeletstatsreceiver/config_test.go @@ -69,7 +69,7 @@ func TestLoadConfig(t *testing.T) { APIConfig: k8sconfig.APIConfig{ AuthType: "tls", }, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: "/path/to/ca.crt", CertFile: "/path/to/apiserver.crt", KeyFile: "/path/to/apiserver.key", diff --git a/receiver/kubeletstatsreceiver/factory_test.go b/receiver/kubeletstatsreceiver/factory_test.go index 1bc8b23ce4ef..88030ba30208 100644 --- a/receiver/kubeletstatsreceiver/factory_test.go +++ b/receiver/kubeletstatsreceiver/factory_test.go @@ -121,7 +121,7 @@ func tlsConfig() *Config { APIConfig: k8sconfig.APIConfig{ AuthType: "tls", }, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: "testdata/testcert.crt", CertFile: "testdata/testcert.crt", KeyFile: "testdata/testkey.key", diff --git a/receiver/mongodbatlasreceiver/alerts.go b/receiver/mongodbatlasreceiver/alerts.go index a1fd7b697885..1aae71729e59 100644 --- a/receiver/mongodbatlasreceiver/alerts.go +++ b/receiver/mongodbatlasreceiver/alerts.go @@ -63,7 +63,7 @@ type alertsReceiver struct { secret string server *http.Server mode string - tlsSettings *configtls.TLSServerSetting + tlsSettings *configtls.ServerConfig consumer consumer.Logs wg *sync.WaitGroup diff --git a/receiver/mongodbatlasreceiver/alerts_integration_test.go b/receiver/mongodbatlasreceiver/alerts_integration_test.go index b884fd94468f..e5bb9a424742 100644 --- a/receiver/mongodbatlasreceiver/alerts_integration_test.go +++ b/receiver/mongodbatlasreceiver/alerts_integration_test.go @@ -128,8 +128,8 @@ func TestAlertsReceiverTLS(t *testing.T) { Secret: testSecret, Mode: alertModeListen, Endpoint: testAddr, - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: filepath.Join("testdata", "alerts", "cert", "server.crt"), KeyFile: filepath.Join("testdata", "alerts", "cert", "server.key"), }, diff --git a/receiver/mongodbatlasreceiver/config.go b/receiver/mongodbatlasreceiver/config.go index aebe2cd86935..d57ca108e57e 100644 --- a/receiver/mongodbatlasreceiver/config.go +++ b/receiver/mongodbatlasreceiver/config.go @@ -37,11 +37,11 @@ type Config struct { } type AlertConfig struct { - Enabled bool `mapstructure:"enabled"` - Endpoint string `mapstructure:"endpoint"` - Secret configopaque.String `mapstructure:"secret"` - TLS *configtls.TLSServerSetting `mapstructure:"tls"` - Mode string `mapstructure:"mode"` + Enabled bool `mapstructure:"enabled"` + Endpoint string `mapstructure:"endpoint"` + Secret configopaque.String `mapstructure:"secret"` + TLS *configtls.ServerConfig `mapstructure:"tls"` + Mode string `mapstructure:"mode"` // these parameters are only relevant in retrieval mode Projects []*ProjectConfig `mapstructure:"projects"` diff --git a/receiver/mongodbatlasreceiver/config_test.go b/receiver/mongodbatlasreceiver/config_test.go index 183d58290053..3a74b09418bb 100644 --- a/receiver/mongodbatlasreceiver/config_test.go +++ b/receiver/mongodbatlasreceiver/config_test.go @@ -88,8 +88,8 @@ func TestValidate(t *testing.T) { Endpoint: "0.0.0.0:7706", Secret: "some_secret", Mode: alertModeListen, - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "some_cert_file", }, }, @@ -106,8 +106,8 @@ func TestValidate(t *testing.T) { Endpoint: "0.0.0.0:7706", Secret: "some_secret", Mode: alertModeListen, - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ KeyFile: "some_key_file", }, }, diff --git a/receiver/mongodbatlasreceiver/factory_test.go b/receiver/mongodbatlasreceiver/factory_test.go index 7bf3d01c6076..f8f2d52ccf53 100644 --- a/receiver/mongodbatlasreceiver/factory_test.go +++ b/receiver/mongodbatlasreceiver/factory_test.go @@ -29,7 +29,7 @@ func TestBadAlertsReceiver(t *testing.T) { cfg := conf.(*Config) cfg.Alerts.Enabled = true - cfg.Alerts.TLS = &configtls.TLSServerSetting{ + cfg.Alerts.TLS = &configtls.ServerConfig{ ClientCAFile: "/not/a/file", } params := receivertest.NewNopCreateSettings() diff --git a/receiver/mongodbreceiver/config.go b/receiver/mongodbreceiver/config.go index 73f6f86e3cf7..f0ed51ea51ce 100644 --- a/receiver/mongodbreceiver/config.go +++ b/receiver/mongodbreceiver/config.go @@ -21,7 +21,7 @@ import ( type Config struct { scraperhelper.ScraperControllerSettings `mapstructure:",squash"` - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + configtls.ClientConfig `mapstructure:"tls,omitempty"` // MetricsBuilderConfig defines which metrics/attributes to enable for the scraper metadata.MetricsBuilderConfig `mapstructure:",squash"` Hosts []confignet.AddrConfig `mapstructure:"hosts"` diff --git a/receiver/mongodbreceiver/config_test.go b/receiver/mongodbreceiver/config_test.go index c9c2121e29e4..d522bf343d6b 100644 --- a/receiver/mongodbreceiver/config_test.go +++ b/receiver/mongodbreceiver/config_test.go @@ -104,13 +104,13 @@ func TestValidate(t *testing.T) { func TestBadTLSConfigs(t *testing.T) { testCases := []struct { desc string - tlsConfig configtls.TLSClientSetting + tlsConfig configtls.ClientConfig expectError bool }{ { desc: "CA file not found", - tlsConfig: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlsConfig: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "not/a/real/file.pem", }, Insecure: false, @@ -121,8 +121,8 @@ func TestBadTLSConfigs(t *testing.T) { }, { desc: "no issues", - tlsConfig: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + tlsConfig: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", @@ -142,7 +142,7 @@ func TestBadTLSConfigs(t *testing.T) { }, }, ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type), - TLSClientSetting: tc.tlsConfig, + ClientConfig: tc.tlsConfig, } err := component.ValidateConfig(cfg) if tc.expectError { @@ -186,9 +186,9 @@ func TestOptionsTLS(t *testing.T) { Endpoint: "localhost:27017", }, }, - TLSClientSetting: configtls.TLSClientSetting{ + ClientConfig: configtls.ClientConfig{ Insecure: false, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: caFile, }, }, diff --git a/receiver/mongodbreceiver/factory.go b/receiver/mongodbreceiver/factory.go index b4823b018d26..e87c7c75737a 100644 --- a/receiver/mongodbreceiver/factory.go +++ b/receiver/mongodbreceiver/factory.go @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { }, }, MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), - TLSClientSetting: configtls.TLSClientSetting{}, + ClientConfig: configtls.ClientConfig{}, } } diff --git a/receiver/mysqlreceiver/config.go b/receiver/mysqlreceiver/config.go index 337891bfee15..9fa92155db1d 100644 --- a/receiver/mysqlreceiver/config.go +++ b/receiver/mysqlreceiver/config.go @@ -28,7 +28,7 @@ type Config struct { Database string `mapstructure:"database,omitempty"` AllowNativePasswords bool `mapstructure:"allow_native_passwords,omitempty"` confignet.AddrConfig `mapstructure:",squash"` - TLS configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLS configtls.ClientConfig `mapstructure:"tls,omitempty"` MetricsBuilderConfig metadata.MetricsBuilderConfig `mapstructure:",squash"` StatementEvents StatementEventsConfig `mapstructure:"statement_events"` } @@ -48,7 +48,7 @@ func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error { // Change the default to Insecure = true as we don't want to break // existing deployments which does not use TLS by default. if !componentParser.IsSet("tls") { - cfg.TLS = configtls.TLSClientSetting{} + cfg.TLS = configtls.ClientConfig{} cfg.TLS.Insecure = true } diff --git a/receiver/nginxreceiver/scraper_test.go b/receiver/nginxreceiver/scraper_test.go index 3d4f76110abf..00c391552570 100644 --- a/receiver/nginxreceiver/scraper_test.go +++ b/receiver/nginxreceiver/scraper_test.go @@ -85,8 +85,8 @@ func TestScraperFailedStart(t *testing.T) { sc := newNginxScraper(receivertest.NewNopCreateSettings(), &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:8080", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/receiver/opencensusreceiver/config_test.go b/receiver/opencensusreceiver/config_test.go index 8e385f12bc34..e8af7f509968 100644 --- a/receiver/opencensusreceiver/config_test.go +++ b/receiver/opencensusreceiver/config_test.go @@ -95,8 +95,8 @@ func TestLoadConfig(t *testing.T) { Transport: confignet.TransportTypeTCP, }, ReadBufferSize: 512 * 1024, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "test.crt", KeyFile: "test.key", }, diff --git a/receiver/opencensusreceiver/opencensus_test.go b/receiver/opencensusreceiver/opencensus_test.go index 1846baae582a..8d2460a5cc0a 100644 --- a/receiver/opencensusreceiver/opencensus_test.go +++ b/receiver/opencensusreceiver/opencensus_test.go @@ -602,8 +602,8 @@ func TestOCReceiverMetrics_HandleNextConsumerResponse(t *testing.T) { func TestInvalidTLSCredentials(t *testing.T) { cfg := Config{ ServerConfig: configgrpc.ServerConfig{ - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "willfail", }, }, diff --git a/receiver/otelarrowreceiver/config_test.go b/receiver/otelarrowreceiver/config_test.go index f52ffc980e42..43d8316de8bb 100644 --- a/receiver/otelarrowreceiver/config_test.go +++ b/receiver/otelarrowreceiver/config_test.go @@ -53,8 +53,8 @@ func TestUnmarshalConfig(t *testing.T) { Endpoint: "0.0.0.0:4317", Transport: confignet.TransportTypeTCP, }, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "test.crt", KeyFile: "test.key", }, diff --git a/receiver/postgresqlreceiver/client.go b/receiver/postgresqlreceiver/client.go index 1a9e47badff1..160b943e0cc0 100644 --- a/receiver/postgresqlreceiver/client.go +++ b/receiver/postgresqlreceiver/client.go @@ -70,10 +70,10 @@ type postgreSQLConfig struct { password string database string address confignet.AddrConfig - tls configtls.TLSClientSetting + tls configtls.ClientConfig } -func sslConnectionString(tls configtls.TLSClientSetting) string { +func sslConnectionString(tls configtls.ClientConfig) string { if tls.Insecure { return "sslmode='disable'" } diff --git a/receiver/postgresqlreceiver/client_factory.go b/receiver/postgresqlreceiver/client_factory.go index da332a660b70..c940bf2ba723 100644 --- a/receiver/postgresqlreceiver/client_factory.go +++ b/receiver/postgresqlreceiver/client_factory.go @@ -40,7 +40,7 @@ func newDefaultClientFactory(cfg *Config) *defaultClientFactory { username: cfg.Username, password: string(cfg.Password), address: cfg.AddrConfig, - tls: cfg.TLSClientSetting, + tls: cfg.ClientConfig, }, } } @@ -73,7 +73,7 @@ func newPoolClientFactory(cfg *Config) *poolClientFactory { username: cfg.Username, password: string(cfg.Password), address: cfg.AddrConfig, - tls: cfg.TLSClientSetting, + tls: cfg.ClientConfig, }, poolConfig: &poolCfg, pool: make(map[string]*sql.DB), diff --git a/receiver/postgresqlreceiver/config.go b/receiver/postgresqlreceiver/config.go index 1d1d425a18f4..735b4689f725 100644 --- a/receiver/postgresqlreceiver/config.go +++ b/receiver/postgresqlreceiver/config.go @@ -34,7 +34,7 @@ type Config struct { Databases []string `mapstructure:"databases"` ExcludeDatabases []string `mapstructure:"exclude_databases"` confignet.AddrConfig `mapstructure:",squash"` // provides Endpoint and Transport - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` // provides SSL details + configtls.ClientConfig `mapstructure:"tls,omitempty"` // provides SSL details ConnectionPool `mapstructure:"connection_pool,omitempty"` metadata.MetricsBuilderConfig `mapstructure:",squash"` } diff --git a/receiver/postgresqlreceiver/config_test.go b/receiver/postgresqlreceiver/config_test.go index bb9a57f9095f..d93a92b60d74 100644 --- a/receiver/postgresqlreceiver/config_test.go +++ b/receiver/postgresqlreceiver/config_test.go @@ -160,10 +160,10 @@ func TestLoadConfig(t *testing.T) { expected.Databases = []string{"otel"} expected.ExcludeDatabases = []string{"template0"} expected.CollectionInterval = 10 * time.Second - expected.TLSClientSetting = configtls.TLSClientSetting{ + expected.ClientConfig = configtls.ClientConfig{ Insecure: false, InsecureSkipVerify: false, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: "/home/otel/authorities.crt", CertFile: "/home/otel/mypostgrescert.crt", KeyFile: "/home/otel/mypostgreskey.key", diff --git a/receiver/postgresqlreceiver/factory.go b/receiver/postgresqlreceiver/factory.go index 7aca869a6dc5..5bb27db6f001 100644 --- a/receiver/postgresqlreceiver/factory.go +++ b/receiver/postgresqlreceiver/factory.go @@ -34,7 +34,7 @@ func createDefaultConfig() component.Config { Endpoint: "localhost:5432", Transport: confignet.TransportTypeTCP, }, - TLSClientSetting: configtls.TLSClientSetting{ + ClientConfig: configtls.ClientConfig{ Insecure: false, InsecureSkipVerify: true, }, diff --git a/receiver/rabbitmqreceiver/client_test.go b/receiver/rabbitmqreceiver/client_test.go index f6427bb3a3fe..113b4bbda05f 100644 --- a/receiver/rabbitmqreceiver/client_test.go +++ b/receiver/rabbitmqreceiver/client_test.go @@ -41,8 +41,8 @@ func TestNewClient(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -57,7 +57,7 @@ func TestNewClient(t *testing.T) { desc: "Valid Configuration", cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/rabbitmqreceiver/scraper_test.go b/receiver/rabbitmqreceiver/scraper_test.go index 527c9d15f53c..bcb64e7e7c56 100644 --- a/receiver/rabbitmqreceiver/scraper_test.go +++ b/receiver/rabbitmqreceiver/scraper_test.go @@ -37,8 +37,8 @@ func TestScraperStart(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -53,7 +53,7 @@ func TestScraperStart(t *testing.T) { scraper: &rabbitmqScraper{ cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/redisreceiver/config.go b/receiver/redisreceiver/config.go index 7a932efc2aad..097f5f6feb16 100644 --- a/receiver/redisreceiver/config.go +++ b/receiver/redisreceiver/config.go @@ -33,7 +33,7 @@ type Config struct { // to a Redis 6.0 instance, or greater, that is using the Redis ACL system. Password configopaque.String `mapstructure:"password"` - TLS configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLS configtls.ClientConfig `mapstructure:"tls,omitempty"` MetricsBuilderConfig metadata.MetricsBuilderConfig `mapstructure:",squash"` } diff --git a/receiver/redisreceiver/config_test.go b/receiver/redisreceiver/config_test.go index 5b404aefc1e0..02882112efdd 100644 --- a/receiver/redisreceiver/config_test.go +++ b/receiver/redisreceiver/config_test.go @@ -35,7 +35,7 @@ func TestConfig(t *testing.T) { Endpoint: "localhost:6379", Transport: confignet.TransportTypeTCP, }, - TLS: configtls.TLSClientSetting{ + TLS: configtls.ClientConfig{ Insecure: true, }, Username: "test", diff --git a/receiver/redisreceiver/factory.go b/receiver/redisreceiver/factory.go index 87864aa7c8af..19196ccd671b 100644 --- a/receiver/redisreceiver/factory.go +++ b/receiver/redisreceiver/factory.go @@ -32,7 +32,7 @@ func createDefaultConfig() component.Config { AddrConfig: confignet.AddrConfig{ Transport: confignet.TransportTypeTCP, }, - TLS: configtls.TLSClientSetting{ + TLS: configtls.ClientConfig{ Insecure: true, }, ScraperControllerSettings: scs, diff --git a/receiver/redisreceiver/redis_scraper_test.go b/receiver/redisreceiver/redis_scraper_test.go index a7da4f803a68..b46a679f74bf 100644 --- a/receiver/redisreceiver/redis_scraper_test.go +++ b/receiver/redisreceiver/redis_scraper_test.go @@ -45,8 +45,8 @@ func TestNewReceiver_invalid_endpoint(t *testing.T) { func TestNewReceiver_invalid_auth_error(t *testing.T) { c := createDefaultConfig().(*Config) - c.TLS = configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + c.TLS = configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/invalid", }, } diff --git a/receiver/riakreceiver/client_test.go b/receiver/riakreceiver/client_test.go index e9ebe738e6ac..e1b0e57e1c00 100644 --- a/receiver/riakreceiver/client_test.go +++ b/receiver/riakreceiver/client_test.go @@ -37,8 +37,8 @@ func TestNewClient(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -50,7 +50,7 @@ func TestNewClient(t *testing.T) { desc: "Valid Configuration", cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/riakreceiver/scraper_test.go b/receiver/riakreceiver/scraper_test.go index 87792b40d345..24d39dd4ce07 100644 --- a/receiver/riakreceiver/scraper_test.go +++ b/receiver/riakreceiver/scraper_test.go @@ -38,8 +38,8 @@ func TestScraperStart(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -55,7 +55,7 @@ func TestScraperStart(t *testing.T) { scraper: &riakScraper{ cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/saphanareceiver/client.go b/receiver/saphanareceiver/client.go index 2c725f23e47e..0462fa0d1bfc 100644 --- a/receiver/saphanareceiver/client.go +++ b/receiver/saphanareceiver/client.go @@ -107,7 +107,7 @@ func (c *sapHanaClient) Connect(ctx context.Context) error { return fmt.Errorf("error generating DSN for SAP HANA connection: %w", err) } - tls, err := c.receiverConfig.TLSClientSetting.LoadTLSConfig() + tls, err := c.receiverConfig.ClientConfig.LoadTLSConfig() if err != nil { return fmt.Errorf("error generating TLS config for SAP HANA connection: %w", err) } diff --git a/receiver/saphanareceiver/config.go b/receiver/saphanareceiver/config.go index 5d7a923ae18e..14c15f4f9a0b 100644 --- a/receiver/saphanareceiver/config.go +++ b/receiver/saphanareceiver/config.go @@ -24,7 +24,7 @@ const ( type Config struct { scraperhelper.ScraperControllerSettings `mapstructure:",squash"` confignet.TCPAddrConfig `mapstructure:",squash"` - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + configtls.ClientConfig `mapstructure:"tls,omitempty"` // MetricsBuilderConfig defines which metrics/attributes to enable for the scraper metadata.MetricsBuilderConfig `mapstructure:",squash"` diff --git a/receiver/saphanareceiver/factory.go b/receiver/saphanareceiver/factory.go index b9d3bd4bd840..d9e3eb520073 100644 --- a/receiver/saphanareceiver/factory.go +++ b/receiver/saphanareceiver/factory.go @@ -37,7 +37,7 @@ func createDefaultConfig() component.Config { TCPAddrConfig: confignet.TCPAddrConfig{ Endpoint: defaultEndpoint, }, - TLSClientSetting: configtls.TLSClientSetting{ + ClientConfig: configtls.ClientConfig{ Insecure: true, }, ScraperControllerSettings: scs, diff --git a/receiver/sapmreceiver/config_test.go b/receiver/sapmreceiver/config_test.go index 8dda68c3e374..12793588a7b6 100644 --- a/receiver/sapmreceiver/config_test.go +++ b/receiver/sapmreceiver/config_test.go @@ -45,8 +45,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "0.0.0.0:7276", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/test.crt", KeyFile: "/test.key", }, diff --git a/receiver/sapmreceiver/trace_receiver_test.go b/receiver/sapmreceiver/trace_receiver_test.go index 247c3c44274b..2446b4f02676 100644 --- a/receiver/sapmreceiver/trace_receiver_test.go +++ b/receiver/sapmreceiver/trace_receiver_test.go @@ -174,8 +174,8 @@ func sendSapm( client := &http.Client{} if tlsEnabled { - tlscs := configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlscs := configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/ca.crt", CertFile: "./testdata/client.crt", KeyFile: "./testdata/client.key", @@ -310,8 +310,8 @@ func TestReception(t *testing.T) { config: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: tlsAddress, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/ca.crt", CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", diff --git a/receiver/signalfxreceiver/config_test.go b/receiver/signalfxreceiver/config_test.go index e1d3f55cca04..1ae28b779f17 100644 --- a/receiver/signalfxreceiver/config_test.go +++ b/receiver/signalfxreceiver/config_test.go @@ -48,8 +48,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "0.0.0.0:9943", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/test.crt", KeyFile: "/test.key", }, diff --git a/receiver/signalfxreceiver/receiver_test.go b/receiver/signalfxreceiver/receiver_test.go index 442c570f0a42..07004c0cdc6b 100644 --- a/receiver/signalfxreceiver/receiver_test.go +++ b/receiver/signalfxreceiver/receiver_test.go @@ -616,8 +616,8 @@ func Test_sfxReceiver_TLS(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) cfg := createDefaultConfig().(*Config) cfg.Endpoint = addr - cfg.ServerConfig.TLSSetting = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.ServerConfig.TLSSetting = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, @@ -666,8 +666,8 @@ func Test_sfxReceiver_TLS(t *testing.T) { require.NoErrorf(t, err, "should have no errors with new request: %v", err) req.Header.Set("Content-Type", "application/x-protobuf") - tlscs := configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlscs := configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/ca.crt", CertFile: "./testdata/client.crt", KeyFile: "./testdata/client.key", diff --git a/receiver/simpleprometheusreceiver/config_test.go b/receiver/simpleprometheusreceiver/config_test.go index 9e4f33132319..2e1190da56b4 100644 --- a/receiver/simpleprometheusreceiver/config_test.go +++ b/receiver/simpleprometheusreceiver/config_test.go @@ -38,8 +38,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:1234", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "path", CertFile: "path", KeyFile: "path", @@ -58,7 +58,7 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:1234", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/receiver/simpleprometheusreceiver/factory.go b/receiver/simpleprometheusreceiver/factory.go index 976ad36d5cc5..ec7cf2f779dd 100644 --- a/receiver/simpleprometheusreceiver/factory.go +++ b/receiver/simpleprometheusreceiver/factory.go @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { return &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/receiver/simpleprometheusreceiver/receiver.go b/receiver/simpleprometheusreceiver/receiver.go index 7fed4cd52ee0..bb885c9dad87 100644 --- a/receiver/simpleprometheusreceiver/receiver.go +++ b/receiver/simpleprometheusreceiver/receiver.go @@ -56,8 +56,8 @@ func (prw *prometheusReceiverWrapper) Start(ctx context.Context, host component. func getPrometheusConfigWrapper(cfg *Config, params receiver.CreateSettings) (*prometheusreceiver.Config, error) { if cfg.TLSEnabled { params.Logger.Warn("the `tls_config` and 'tls_enabled' settings are deprecated, please use `tls` instead") - cfg.ClientConfig.TLSSetting = configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.ClientConfig.TLSSetting = configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: cfg.TLSConfig.CAFile, CertFile: cfg.TLSConfig.CertFile, KeyFile: cfg.TLSConfig.KeyFile, diff --git a/receiver/simpleprometheusreceiver/receiver_test.go b/receiver/simpleprometheusreceiver/receiver_test.go index 87e40f01ff0c..f03f23405542 100644 --- a/receiver/simpleprometheusreceiver/receiver_test.go +++ b/receiver/simpleprometheusreceiver/receiver_test.go @@ -77,7 +77,7 @@ func TestGetPrometheusConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:1234", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -115,8 +115,8 @@ func TestGetPrometheusConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:1234", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/test_cert.pem", }, InsecureSkipVerify: true, @@ -221,7 +221,7 @@ func TestGetPrometheusConfigWrapper(t *testing.T) { }, ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -268,7 +268,7 @@ func TestGetPrometheusConfigWrapper(t *testing.T) { }, ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -309,7 +309,7 @@ func TestGetPrometheusConfigWrapper(t *testing.T) { }, ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -350,9 +350,9 @@ func TestGetPrometheusConfigWrapper(t *testing.T) { }, ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: "./testdata/test_cert.pem", }, }, diff --git a/receiver/skywalkingreceiver/factory_test.go b/receiver/skywalkingreceiver/factory_test.go index d9a1649826ca..b9a150372c52 100644 --- a/receiver/skywalkingreceiver/factory_test.go +++ b/receiver/skywalkingreceiver/factory_test.go @@ -109,8 +109,8 @@ func TestCreateTLSGPRCEndpoint(t *testing.T) { Endpoint: "0.0.0.0:11800", Transport: confignet.TransportTypeTCP, }, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, @@ -128,8 +128,8 @@ func TestCreateTLSHTTPEndpoint(t *testing.T) { cfg.(*Config).Protocols.HTTP = &confighttp.ServerConfig{ Endpoint: "0.0.0.0:12800", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, diff --git a/receiver/solacereceiver/config.go b/receiver/solacereceiver/config.go index 40e75a25efd4..2e4316c1c986 100644 --- a/receiver/solacereceiver/config.go +++ b/receiver/solacereceiver/config.go @@ -37,7 +37,7 @@ type Config struct { // The maximum number of unacknowledged messages the Solace broker can transmit, to configure AMQP Link MaxUnacked int32 `mapstructure:"max_unacknowledged"` - TLS configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLS configtls.ClientConfig `mapstructure:"tls,omitempty"` Auth Authentication `mapstructure:"auth"` diff --git a/receiver/solacereceiver/config_test.go b/receiver/solacereceiver/config_test.go index 3c6a66e48b47..c3746a417c5a 100644 --- a/receiver/solacereceiver/config_test.go +++ b/receiver/solacereceiver/config_test.go @@ -40,7 +40,7 @@ func TestLoadConfig(t *testing.T) { }, Queue: "queue://#trace-profile123", MaxUnacked: 1234, - TLS: configtls.TLSClientSetting{ + TLS: configtls.ClientConfig{ Insecure: false, InsecureSkipVerify: false, }, diff --git a/receiver/solacereceiver/factory.go b/receiver/solacereceiver/factory.go index 574aaf522446..6e75725747f9 100644 --- a/receiver/solacereceiver/factory.go +++ b/receiver/solacereceiver/factory.go @@ -37,7 +37,7 @@ func createDefaultConfig() component.Config { Broker: []string{defaultHost}, MaxUnacked: defaultMaxUnaked, Auth: Authentication{}, - TLS: configtls.TLSClientSetting{ + TLS: configtls.ClientConfig{ InsecureSkipVerify: false, Insecure: false, }, diff --git a/receiver/solacereceiver/messaging_service_test.go b/receiver/solacereceiver/messaging_service_test.go index 678ad4f5666d..f2099f5ab95d 100644 --- a/receiver/solacereceiver/messaging_service_test.go +++ b/receiver/solacereceiver/messaging_service_test.go @@ -85,7 +85,7 @@ func TestNewAMQPMessagingServiceFactory(t *testing.T) { name: "expecting authentication errors", cfg: &Config{ // no password Auth: Authentication{PlainText: &SaslPlainTextConfig{Username: "set"}}, - TLS: configtls.TLSClientSetting{Insecure: false, InsecureSkipVerify: false}, + TLS: configtls.ClientConfig{Insecure: false, InsecureSkipVerify: false}, Broker: []string{broker}, Queue: queue, MaxUnacked: maxUnacked, @@ -97,7 +97,7 @@ func TestNewAMQPMessagingServiceFactory(t *testing.T) { name: "expecting tls errors", cfg: &Config{ // invalid to only provide a key file Auth: Authentication{PlainText: &SaslPlainTextConfig{Username: "user", Password: "password"}}, - TLS: configtls.TLSClientSetting{TLSSetting: configtls.TLSSetting{KeyFile: "someKeyFile"}, Insecure: false}, + TLS: configtls.ClientConfig{TLSSetting: configtls.Config{KeyFile: "someKeyFile"}, Insecure: false}, Broker: []string{broker}, Queue: queue, MaxUnacked: maxUnacked, @@ -109,7 +109,7 @@ func TestNewAMQPMessagingServiceFactory(t *testing.T) { name: "expecting success with TLS expecting an amqps connection", cfg: &Config{ // invalid to only provide a key file Auth: Authentication{PlainText: &SaslPlainTextConfig{Username: "user", Password: "password"}}, - TLS: configtls.TLSClientSetting{Insecure: false}, + TLS: configtls.ClientConfig{Insecure: false}, Broker: []string{broker}, Queue: queue, MaxUnacked: maxUnacked, @@ -133,7 +133,7 @@ func TestNewAMQPMessagingServiceFactory(t *testing.T) { name: "expecting success without TLS expecting an amqp connection", cfg: &Config{ // invalid to only provide a key file Auth: Authentication{PlainText: &SaslPlainTextConfig{Username: "user", Password: "password"}}, - TLS: configtls.TLSClientSetting{Insecure: true}, + TLS: configtls.ClientConfig{Insecure: true}, Broker: []string{broker}, Queue: queue, MaxUnacked: maxUnacked, diff --git a/receiver/splunkhecreceiver/config_test.go b/receiver/splunkhecreceiver/config_test.go index 22a73fbd3a0d..595968959d28 100644 --- a/receiver/splunkhecreceiver/config_test.go +++ b/receiver/splunkhecreceiver/config_test.go @@ -57,8 +57,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "0.0.0.0:8088", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/test.crt", KeyFile: "/test.key", }, diff --git a/receiver/splunkhecreceiver/receiver_test.go b/receiver/splunkhecreceiver/receiver_test.go index b87c26305619..5f85cd8277e0 100644 --- a/receiver/splunkhecreceiver/receiver_test.go +++ b/receiver/splunkhecreceiver/receiver_test.go @@ -442,8 +442,8 @@ func Test_splunkhecReceiver_TLS(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) cfg := createDefaultConfig().(*Config) cfg.Endpoint = addr - cfg.TLSSetting = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.TLSSetting = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, @@ -494,8 +494,8 @@ func Test_splunkhecReceiver_TLS(t *testing.T) { req, err := http.NewRequestWithContext(context.Background(), "POST", url, bytes.NewReader(body)) require.NoErrorf(t, err, "should have no errors with new request: %v", err) - tlscs := configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlscs := configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/ca.crt", CertFile: "./testdata/client.crt", KeyFile: "./testdata/client.key", diff --git a/receiver/vcenterreceiver/README.md b/receiver/vcenterreceiver/README.md index 3534169ecba8..184e27529c36 100644 --- a/receiver/vcenterreceiver/README.md +++ b/receiver/vcenterreceiver/README.md @@ -34,7 +34,7 @@ A “Read Only” user assigned to a vSphere with permissions to the vCenter ser | endpoint | | String | Endpoint to the vCenter Server or ESXi host that has the sdk path enabled. Required. The expected format is `://`

i.e: `https://vcsa.hostname.localnet` | | username | | String | Required | | password | | String | Required | -| tls | | TLSClientSetting | Not Required. Will use defaults for [configtls.TLSClientSetting](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md). By default insecure settings are rejected and certificate verification is on. | +| tls | | TLSClientSetting | Not Required. Will use defaults for [configtls.ClientConfig](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md). By default insecure settings are rejected and certificate verification is on. | | collection_interval | 2m | Duration | This receiver collects metrics on an interval. If the vCenter is fairly large, this value may need to be increased. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h` | | initial_delay | 1s | Duration | Defines how long this receiver waits before starting. | diff --git a/receiver/vcenterreceiver/client_test.go b/receiver/vcenterreceiver/client_test.go index fd42d979d6e4..fb3cf28ce1a3 100644 --- a/receiver/vcenterreceiver/client_test.go +++ b/receiver/vcenterreceiver/client_test.go @@ -73,7 +73,7 @@ func TestSessionReestablish(t *testing.T) { Username: simulator.DefaultLogin.Username(), Password: configopaque.String(pw), Endpoint: fmt.Sprintf("%s://%s", c.URL().Scheme, c.URL().Host), - TLSClientSetting: configtls.TLSClientSetting{ + ClientConfig: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/receiver/vcenterreceiver/config.go b/receiver/vcenterreceiver/config.go index 40f31e0fd73d..9cfb0b984b03 100644 --- a/receiver/vcenterreceiver/config.go +++ b/receiver/vcenterreceiver/config.go @@ -19,7 +19,7 @@ import ( // Config is the configuration of the receiver type Config struct { scraperhelper.ScraperControllerSettings `mapstructure:",squash"` - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + configtls.ClientConfig `mapstructure:"tls,omitempty"` metadata.MetricsBuilderConfig `mapstructure:",squash"` Endpoint string `mapstructure:"endpoint"` Username string `mapstructure:"username"` diff --git a/receiver/vcenterreceiver/config_test.go b/receiver/vcenterreceiver/config_test.go index 13297408db20..54639e7f56f4 100644 --- a/receiver/vcenterreceiver/config_test.go +++ b/receiver/vcenterreceiver/config_test.go @@ -53,7 +53,7 @@ func TestConfigValidation(t *testing.T) { desc: "unparseable URL", cfg: Config{ Endpoint: "h" + string(rune(0x7f)), - TLSClientSetting: configtls.TLSClientSetting{}, + ClientConfig: configtls.ClientConfig{}, ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type), }, expectedErr: errors.New("unable to parse url"), diff --git a/receiver/vcenterreceiver/factory.go b/receiver/vcenterreceiver/factory.go index 673d40d088a3..5775cc49414f 100644 --- a/receiver/vcenterreceiver/factory.go +++ b/receiver/vcenterreceiver/factory.go @@ -32,7 +32,7 @@ func createDefaultConfig() component.Config { return &Config{ ScraperControllerSettings: cfg, - TLSClientSetting: configtls.TLSClientSetting{}, + ClientConfig: configtls.ClientConfig{}, MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } } diff --git a/receiver/vcenterreceiver/integration_test.go b/receiver/vcenterreceiver/integration_test.go index 44191affcc23..49f08eb1c150 100644 --- a/receiver/vcenterreceiver/integration_test.go +++ b/receiver/vcenterreceiver/integration_test.go @@ -61,7 +61,7 @@ func TestIntegration(t *testing.T) { rCfg.Endpoint = fmt.Sprintf("%s://%s", c.URL().Scheme, c.URL().Host) rCfg.Username = simulator.DefaultLogin.Username() rCfg.Password = configopaque.String(pw) - rCfg.TLSClientSetting = configtls.TLSClientSetting{ + rCfg.ClientConfig = configtls.ClientConfig{ Insecure: true, } }), diff --git a/testbed/datasenders/jaeger.go b/testbed/datasenders/jaeger.go index 39f380c5a704..5de7c6d5616b 100644 --- a/testbed/datasenders/jaeger.go +++ b/testbed/datasenders/jaeger.go @@ -98,7 +98,7 @@ func (cfg *jaegerConfig) Validate() error { func (je *jaegerGRPCDataSender) newTracesExporter(set exporter.CreateSettings) (exporter.Traces, error) { cfg := jaegerConfig{} cfg.Endpoint = je.GetEndpoint().String() - cfg.TLSSetting = configtls.TLSClientSetting{ + cfg.TLSSetting = configtls.ClientConfig{ Insecure: true, } diff --git a/testbed/datasenders/opencensus.go b/testbed/datasenders/opencensus.go index bbaca7339179..458938518e76 100644 --- a/testbed/datasenders/opencensus.go +++ b/testbed/datasenders/opencensus.go @@ -23,7 +23,7 @@ type ocDataSender struct { func (ods *ocDataSender) fillConfig(cfg *opencensusexporter.Config) *opencensusexporter.Config { cfg.Endpoint = ods.GetEndpoint().String() - cfg.TLSSetting = configtls.TLSClientSetting{ + cfg.TLSSetting = configtls.ClientConfig{ Insecure: true, } return cfg diff --git a/testbed/testbed/senders.go b/testbed/testbed/senders.go index 684763501004..8501f22b08f3 100644 --- a/testbed/testbed/senders.go +++ b/testbed/testbed/senders.go @@ -87,7 +87,7 @@ func (ods *otlpHTTPDataSender) fillConfig(cfg *otlphttpexporter.Config) *otlphtt cfg.RetryConfig.Enabled = false // Disable sending queue, we should push data from the caller goroutine. cfg.QueueConfig.Enabled = false - cfg.TLSSetting = configtls.TLSClientSetting{ + cfg.TLSSetting = configtls.ClientConfig{ Insecure: true, } cfg.Compression = ods.compression @@ -219,7 +219,7 @@ func (ods *otlpDataSender) fillConfig(cfg *otlpexporter.Config) *otlpexporter.Co cfg.RetryConfig.Enabled = false // Disable sending queue, we should push data from the caller goroutine. cfg.QueueConfig.Enabled = false - cfg.TLSSetting = configtls.TLSClientSetting{ + cfg.TLSSetting = configtls.ClientConfig{ Insecure: true, } return cfg