From 09fad1640c72e1c7b19450df075ea76e88d45cad Mon Sep 17 00:00:00 2001 From: Sourik Ghosh Date: Mon, 14 Mar 2022 14:16:46 +0530 Subject: [PATCH 1/2] silence tlsCert.RootCAs.Subjects is deprecated lint err Signed-off-by: Sourik Ghosh --- exporters/otlp/internal/envconfig/envconfig_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exporters/otlp/internal/envconfig/envconfig_test.go b/exporters/otlp/internal/envconfig/envconfig_test.go index b141cd42b93..eaf85b1ec7a 100644 --- a/exporters/otlp/internal/envconfig/envconfig_test.go +++ b/exporters/otlp/internal/envconfig/envconfig_test.go @@ -288,6 +288,8 @@ func TestWithTLSConfig(t *testing.T) { WithTLSConfig("CERTIFICATE", func(v *tls.Config) { option = testOption{TestTLS: v} })) + + // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. assert.Equal(t, tlsCert.RootCAs.Subjects(), option.TestTLS.RootCAs.Subjects()) } From 0d8ed8ab1513e5f9ba7465f839d7c62958f89a08 Mon Sep 17 00:00:00 2001 From: Sourik Ghosh Date: Tue, 15 Mar 2022 08:55:09 +0530 Subject: [PATCH 2/2] silence rest of the occurrence Signed-off-by: Sourik Ghosh --- exporters/otlp/otlpmetric/internal/otlpconfig/options_test.go | 3 +++ exporters/otlp/otlptrace/internal/otlpconfig/options_test.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/exporters/otlp/otlpmetric/internal/otlpconfig/options_test.go b/exporters/otlp/otlpmetric/internal/otlpconfig/options_test.go index fad37d60be5..3496b17cccd 100644 --- a/exporters/otlp/otlpmetric/internal/otlpconfig/options_test.go +++ b/exporters/otlp/otlpmetric/internal/otlpconfig/options_test.go @@ -202,6 +202,7 @@ func TestConfigs(t *testing.T) { //TODO: make sure gRPC's credentials actually works assert.NotNil(t, c.Metrics.GRPCCredentials) } else { + // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. assert.Equal(t, tlsCert.RootCAs.Subjects(), c.Metrics.TLSCfg.RootCAs.Subjects()) } }, @@ -218,6 +219,7 @@ func TestConfigs(t *testing.T) { if grpcOption { assert.NotNil(t, c.Metrics.GRPCCredentials) } else { + // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. assert.Equal(t, tlsCert.RootCAs.Subjects(), c.Metrics.TLSCfg.RootCAs.Subjects()) } }, @@ -236,6 +238,7 @@ func TestConfigs(t *testing.T) { if grpcOption { assert.NotNil(t, c.Metrics.GRPCCredentials) } else { + // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. assert.Equal(t, tlsCert.RootCAs.Subjects(), c.Metrics.TLSCfg.RootCAs.Subjects()) } }, diff --git a/exporters/otlp/otlptrace/internal/otlpconfig/options_test.go b/exporters/otlp/otlptrace/internal/otlpconfig/options_test.go index 30dc5ea8015..3d50e057bef 100644 --- a/exporters/otlp/otlptrace/internal/otlpconfig/options_test.go +++ b/exporters/otlp/otlptrace/internal/otlpconfig/options_test.go @@ -202,6 +202,7 @@ func TestConfigs(t *testing.T) { //TODO: make sure gRPC's credentials actually works assert.NotNil(t, c.Traces.GRPCCredentials) } else { + // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. assert.Equal(t, tlsCert.RootCAs.Subjects(), c.Traces.TLSCfg.RootCAs.Subjects()) } }, @@ -218,6 +219,7 @@ func TestConfigs(t *testing.T) { if grpcOption { assert.NotNil(t, c.Traces.GRPCCredentials) } else { + // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. assert.Equal(t, tlsCert.RootCAs.Subjects(), c.Traces.TLSCfg.RootCAs.Subjects()) } }, @@ -236,6 +238,7 @@ func TestConfigs(t *testing.T) { if grpcOption { assert.NotNil(t, c.Traces.GRPCCredentials) } else { + // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. assert.Equal(t, tlsCert.RootCAs.Subjects(), c.Traces.TLSCfg.RootCAs.Subjects()) } }, @@ -253,6 +256,7 @@ func TestConfigs(t *testing.T) { if grpcOption { assert.NotNil(t, c.Traces.GRPCCredentials) } else { + // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. assert.Equal(t, tlsCert.RootCAs.Subjects(), c.Traces.TLSCfg.RootCAs.Subjects()) } },