Skip to content

Commit

Permalink
fix: revert tls change
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
Dominik Rosiek committed Oct 5, 2023
1 parent 2fb6219 commit dc90d91
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .chloggen/drosiek-syslog-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ change_type: bug_fix
component: syslogexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: fix default behaviour (disable tls and use proper defaults)
note: use proper defaults according to RFCs

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [21245]
issues: [25114]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
Expand Down
2 changes: 1 addition & 1 deletion exporter/syslogexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Config struct {
Protocol string `mapstructure:"protocol"`

// TLSSetting struct exposes TLS client configuration.
TLSSetting *configtls.TLSClientSetting `mapstructure:"tls"`
TLSSetting configtls.TLSClientSetting `mapstructure:"tls"`

exporterhelper.QueueSettings `mapstructure:"sending_queue"`
exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`
Expand Down
11 changes: 3 additions & 8 deletions exporter/syslogexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@ type syslogexporter struct {
}

func initExporter(cfg *Config, createSettings exporter.CreateSettings) (*syslogexporter, error) {
var tlsConfig *tls.Config
var err error

if cfg.TLSSetting != nil {
tlsConfig, err = cfg.TLSSetting.LoadTLSConfig()
if err != nil {
return nil, err
}
tlsConfig, err := cfg.TLSSetting.LoadTLSConfig()
if err != nil {
return nil, err
}

cfg.Network = strings.ToLower(cfg.Network)
Expand Down
5 changes: 1 addition & 4 deletions exporter/syslogexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/pdata/pcommon"
Expand Down Expand Up @@ -135,9 +134,7 @@ func prepareExporterTest(t *testing.T, cfg *Config, invalidExporter bool) *expor
func createTestConfig() *Config {
config := createDefaultConfig().(*Config)
config.Network = "tcp"
config.TLSSetting = &configtls.TLSClientSetting{
Insecure: true,
}
config.TLSSetting.Insecure = true
return config
}

Expand Down

0 comments on commit dc90d91

Please sign in to comment.