Skip to content

Commit

Permalink
Do not squash configtls.TLSClientSetting in confighttp and `cnofi…
Browse files Browse the repository at this point in the history
…ggrpc` config
  • Loading branch information
mxiamxia committed Sep 16, 2021
1 parent f3cd422 commit 9e27b34
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/configgrpc/configgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type GRPCClientSettings struct {
Compression string `mapstructure:"compression"`

// TLSSetting struct exposes TLS client configuration.
TLSSetting configtls.TLSClientSetting `mapstructure:",squash"`
TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"`

// The keepalive parameters for gRPC client. See grpc.WithKeepaliveParams.
// (https://godoc.org/google.golang.org/grpc#WithKeepaliveParams).
Expand Down
2 changes: 1 addition & 1 deletion config/confighttp/confighttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type HTTPClientSettings struct {
Endpoint string `mapstructure:"endpoint"`

// TLSSetting struct exposes TLS client configuration.
TLSSetting configtls.TLSClientSetting `mapstructure:",squash"`
TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"`

// ReadBufferSize for HTTP client. See http.Transport.ReadBufferSize.
ReadBufferSize int `mapstructure:"read_buffer_size"`
Expand Down
3 changes: 2 additions & 1 deletion exporter/otlpexporter/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ exporters:
otlp/2:
endpoint: "1.2.3.4:1234"
compression: "on"
ca_file: /var/lib/mycert.pem
tls:
ca_file: /var/lib/mycert.pem
timeout: 10s
sending_queue:
enabled: true
Expand Down
9 changes: 5 additions & 4 deletions exporter/otlphttpexporter/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ exporters:
otlphttp:
otlphttp/2:
endpoint: "https://1.2.3.4:1234"
insecure: true
ca_file: /var/lib/mycert.pem
cert_file: certfile
key_file: keyfile
tls:
ca_file: /var/lib/mycert.pem
cert_file: certfile
key_file: keyfile
insecure: true
timeout: 10s
read_buffer_size: 123
write_buffer_size: 345
Expand Down

0 comments on commit 9e27b34

Please sign in to comment.