Skip to content

Commit

Permalink
silence tlsCert.RootCAs.Subjects is deprecated lint err (#2674)
Browse files Browse the repository at this point in the history
* silence tlsCert.RootCAs.Subjects is deprecated lint err

Signed-off-by: Sourik Ghosh <sourikghosh31@gmail.com>

* silence rest of the occurrence

Signed-off-by: Sourik Ghosh <sourikghosh31@gmail.com>

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 16, 2022
1 parent 2cfc521 commit 0fe5eee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exporters/otlp/internal/envconfig/envconfig_test.go
Expand Up @@ -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())
}

Expand Down
3 changes: 3 additions & 0 deletions exporters/otlp/otlpmetric/internal/otlpconfig/options_test.go
Expand Up @@ -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())
}
},
Expand All @@ -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())
}
},
Expand All @@ -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())
}
},
Expand Down
4 changes: 4 additions & 0 deletions exporters/otlp/otlptrace/internal/otlpconfig/options_test.go
Expand Up @@ -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())
}
},
Expand All @@ -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())
}
},
Expand All @@ -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())
}
},
Expand All @@ -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())
}
},
Expand Down

0 comments on commit 0fe5eee

Please sign in to comment.