Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Po-Yao Chen committed Nov 11, 2024
1 parent b5979af commit 33073d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ type Config struct {
ClientCertPath string
// ClientKeyPath specifies path to client key used to obtain mTLS with OTel collector.
ClientKeyPath string
// OTelCACertPath specifies path to root CA cert, used to verify OTel collector cert.
OTelCACertPath string
// CACertPath specifies path to root CA cert, used to verify OTel collector cert.
CACertPath string
}
}

Expand Down
6 changes: 3 additions & 3 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ func TestParse(t *testing.T) {
OTELCollectorEndpoint string
ClientCertPath string
ClientKeyPath string
OTelCACertPath string
CACertPath string
}{
Enabled: true,
OTELCollectorEndpoint: "http://localhost:4317",
OTELCollectorEndpoint: "http://loetalhost:4317",
ClientCertPath: "/path/to/client/cert",
ClientKeyPath: "/path/to/client/key",
OTelCACertPath: "/path/to/ca/cert",
CACertPath: "/path/to/ca/cert",
},
}
testcases := map[string]struct {
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/testconf-good.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"OTELCollectorEndpoint": "http://localhost:4317",
"ClientCertPath": "/path/to/client/cert",
"ClientKeyPath": "/path/to/client/key",
"OTelCACertPath": "/path/to/ca/cert"
"CACertPath": "/path/to/ca/cert"
}
}
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func Main() {
if err != nil {
log.Fatalf("Error merging resources: %v", err)
}
otelTLSConf, err := tlsClientConfiguration(cfg.OTel.OTelCACertPath, cfg.OTel.ClientCertPath,
otelTLSConf, err := tlsClientConfiguration(cfg.OTel.CACertPath, cfg.OTel.ClientCertPath,
cfg.OTel.ClientKeyPath)
if err != nil {
log.Fatalf("Error loading otel TLS config: %v", err)
Expand Down

0 comments on commit 33073d7

Please sign in to comment.