Skip to content

Commit

Permalink
[chore][internal/aws/k8s/k8sclient] Enable goleak check (open-telemet…
Browse files Browse the repository at this point in the history
…ry#30761)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
This adds the `goleak` check for the `internal/aws/k8s/k8sclient`
package. The only update needed was to add a missing `shutdown` call to
a client in a test. This was a test only change.

**Link to tracking Issue:** <Issue number if applicable>
open-telemetry#30438

**Testing:** <Describe what testing was performed and which tests were
added.>
All tests are passing, as well as added goleak check.

---------

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
  • Loading branch information
2 people authored and XinRanZhAWS committed Mar 13, 2024
1 parent 98b7813 commit 28ef446
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/aws/k8s/k8sclient/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,5 +416,6 @@ func TestNewEndpointClient(t *testing.T) {
fakeClientSet := fake.NewSimpleClientset(endpointsArray...)
client := newEpClient(fakeClientSet, zap.NewNop(), setOption)
assert.NotNil(t, client)
client.shutdown()
removeTempKubeConfig()
}
14 changes: 14 additions & 0 deletions internal/aws/k8s/k8sclient/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package k8sclient

import (
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}

0 comments on commit 28ef446

Please sign in to comment.