Skip to content

Commit 6ad7079

Browse files
committed
Fix golangci-lint contextcheck error
Signed-off-by: Richard Wall <[email protected]>
1 parent 02aa2f9 commit 6ad7079

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkg/agent/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ func Test_ValidateAndCombineConfig_VenafiConnection(t *testing.T) {
750750
withCmdLineFlags("--venafi-connection", "venafi-components", "--install-namespace", "venafi"))
751751
require.NoError(t, err)
752752

753-
testutil.VenConnStartWatching(t, cl)
753+
testutil.VenConnStartWatching(ctx, t, cl)
754754
testutil.TrustCA(t, cl, cert)
755755

756756
// TODO(mael): the client should keep track of the cluster ID, we

pkg/client/client_venconn_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func run_TestVenConnClient_PostDataReadingsWithOptions(ctx context.Context, rest
256256
)
257257
require.NoError(t, err)
258258

259-
testutil.VenConnStartWatching(t, cl)
259+
testutil.VenConnStartWatching(ctx, t, cl)
260260

261261
test.given = strings.ReplaceAll(test.given, "FAKE_VENAFI_CLOUD_URL", fakeVenafiCloud.URL)
262262
test.given = strings.ReplaceAll(test.given, "FAKE_TPP_URL", fakeTPP.URL)

pkg/testutil/envtest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func WithKubeconfig(t testing.TB, restCfg *rest.Config) string {
106106
// Tests calling to VenConnClient.PostDataReadingsWithOptions must call this
107107
// function to start the VenafiConnection watcher. If you don't call this, the
108108
// test will stall.
109-
func VenConnStartWatching(t *testing.T, cl client.Client) {
109+
func VenConnStartWatching(ctx context.Context, t *testing.T, cl client.Client) {
110110
t.Helper()
111111

112112
require.IsType(t, &client.VenConnClient{}, cl)
@@ -116,7 +116,7 @@ func VenConnStartWatching(t *testing.T, cl client.Client) {
116116
// the message "timeout waiting for process kube-apiserver to stop". See:
117117
// https://github.com/jetstack/venafi-connection-lib/pull/158#issuecomment-1949002322
118118
// https://github.com/kubernetes-sigs/controller-runtime/issues/1571#issuecomment-945535598
119-
ctx, cancel := context.WithCancel(context.Background())
119+
ctx, cancel := context.WithCancel(ctx)
120120
go func() {
121121
err := cl.(*client.VenConnClient).Start(ctx)
122122
require.NoError(t, err)

0 commit comments

Comments
 (0)