Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed Jul 31, 2023
1 parent b60eb76 commit 9d6ffd8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions pkg/traces/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ const (

// otlp receiver
otlpReceiverName = "otlp"

// A string to print out when marshaling "secrets" strings, like passwords.
secretMarshalString = "<secret>"
)

// Config controls the configuration of Traces trace pipelines.
Expand Down Expand Up @@ -170,7 +173,7 @@ var (

// MarshalYAML implements yaml.Marshaler.
func (s SecretString) MarshalYAML() (interface{}, error) {
return "<secret>", nil
return secretMarshalString, nil
}

// JaegerRemoteSamplingMap is a set of Jaeger Remote Sampling extensions.
Expand All @@ -184,7 +187,7 @@ var (

// MarshalYAML implements yaml.Marshaler.
func (jrsm JaegerRemoteSamplingConfig) MarshalYAML() (interface{}, error) {
return "<secret>", nil
return secretMarshalString, nil
}

// ReceiverMap stores a set of receivers. Because receivers may be configured
Expand Down Expand Up @@ -238,7 +241,7 @@ func (r *ReceiverMap) UnmarshalYAML(unmarshal func(interface{}) error) error {

// MarshalYAML implements yaml.Marshaler.
func (r ReceiverMap) MarshalYAML() (interface{}, error) {
return "<secret>", nil
return secretMarshalString, nil
}

const (
Expand Down
12 changes: 6 additions & 6 deletions pkg/traces/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1304,9 +1304,9 @@ remote_write:
tls:
insecure: true
insecure_skip_verify: true
ca_pem: secrety_secret_ca_pem_string
cert_pem: secrety_secret_cert_pem_string
key_pem: secrety_secret_key_pem_string
ca_pem: test_secret_ca_pem_string
cert_pem: test_secret_cert_pem_string
key_pem: test_secret_key_pem_string
max_version: 1.2
reload_interval: 1h
`,
Expand All @@ -1328,9 +1328,9 @@ extensions:
tls:
insecure: true
insecure_skip_verify: true
ca_pem: secrety_secret_ca_pem_string
cert_pem: secrety_secret_cert_pem_string
key_pem: secrety_secret_key_pem_string
ca_pem: test_secret_ca_pem_string
cert_pem: test_secret_cert_pem_string
key_pem: test_secret_key_pem_string
max_version: 1.2
reload_interval: 1h
exporters:
Expand Down

0 comments on commit 9d6ffd8

Please sign in to comment.