Skip to content

Commit

Permalink
Fix golangci-lint contextcheck error
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Wall <[email protected]>
  • Loading branch information
wallrj committed Nov 27, 2024
1 parent 02aa2f9 commit 6ad7079
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/agent/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ func Test_ValidateAndCombineConfig_VenafiConnection(t *testing.T) {
withCmdLineFlags("--venafi-connection", "venafi-components", "--install-namespace", "venafi"))
require.NoError(t, err)

testutil.VenConnStartWatching(t, cl)
testutil.VenConnStartWatching(ctx, t, cl)
testutil.TrustCA(t, cl, cert)

// TODO(mael): the client should keep track of the cluster ID, we
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client_venconn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func run_TestVenConnClient_PostDataReadingsWithOptions(ctx context.Context, rest
)
require.NoError(t, err)

testutil.VenConnStartWatching(t, cl)
testutil.VenConnStartWatching(ctx, t, cl)

test.given = strings.ReplaceAll(test.given, "FAKE_VENAFI_CLOUD_URL", fakeVenafiCloud.URL)
test.given = strings.ReplaceAll(test.given, "FAKE_TPP_URL", fakeTPP.URL)
Expand Down
4 changes: 2 additions & 2 deletions pkg/testutil/envtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func WithKubeconfig(t testing.TB, restCfg *rest.Config) string {
// Tests calling to VenConnClient.PostDataReadingsWithOptions must call this
// function to start the VenafiConnection watcher. If you don't call this, the
// test will stall.
func VenConnStartWatching(t *testing.T, cl client.Client) {
func VenConnStartWatching(ctx context.Context, t *testing.T, cl client.Client) {
t.Helper()

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

0 comments on commit 6ad7079

Please sign in to comment.