diff --git a/config/config.go b/config/config.go index 3ce118a..f6fa24a 100644 --- a/config/config.go +++ b/config/config.go @@ -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 } } diff --git a/config/config_test.go b/config/config_test.go index 608ecde..52579b3 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -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 { diff --git a/config/testdata/testconf-good.json b/config/testdata/testconf-good.json index 89777db..ba750db 100644 --- a/config/testdata/testconf-good.json +++ b/config/testdata/testconf-good.json @@ -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" } } diff --git a/server/server.go b/server/server.go index 61d1e8b..d26174c 100644 --- a/server/server.go +++ b/server/server.go @@ -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)