diff --git a/.golangci.yml b/.golangci.yml index 2adedd46ec..d04a9c6456 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,7 +13,7 @@ linters: - asciicheck - bidichk - bodyclose - # - containedctx + - containedctx - dogsled - dupword - durationcheck diff --git a/pkg/context/controller_manager_context.go b/pkg/context/controller_manager_context.go index f9befc697f..d0576e2c4c 100644 --- a/pkg/context/controller_manager_context.go +++ b/pkg/context/controller_manager_context.go @@ -33,7 +33,7 @@ import ( // ControllerManagerContext is the context of the controller that owns the // controllers. type ControllerManagerContext struct { - context.Context + context.Context //nolint:containedctx // Namespace is the namespace in which the resource is located responsible // for running the controller manager. diff --git a/pkg/services/govmomi/cluster/cluster_suite_test.go b/pkg/services/govmomi/cluster/cluster_suite_test.go index d06001b12a..d872a74c76 100644 --- a/pkg/services/govmomi/cluster/cluster_suite_test.go +++ b/pkg/services/govmomi/cluster/cluster_suite_test.go @@ -33,8 +33,8 @@ func TestCluster(t *testing.T) { } type testComputeClusterCtx struct { - context.Context - finder *find.Finder + context.Context //nolint:containedctx + finder *find.Finder } func (t testComputeClusterCtx) GetSession() *session.Session { diff --git a/pkg/util/fetch_object.go b/pkg/util/fetch_object.go index 8aced44c67..3d26720822 100644 --- a/pkg/util/fetch_object.go +++ b/pkg/util/fetch_object.go @@ -28,7 +28,7 @@ import ( ) type FetchObjectInput struct { - context.Context + context.Context //nolint:containedctx ctrlclient.Client Object ctrlclient.Object } diff --git a/test/helpers/vmware/intg_test_context.go b/test/helpers/vmware/intg_test_context.go index ffc712b6c4..73faea7c20 100644 --- a/test/helpers/vmware/intg_test_context.go +++ b/test/helpers/vmware/intg_test_context.go @@ -41,7 +41,7 @@ import ( // IntegrationTestContext is used for integration testing // Supervisor controllers. type IntegrationTestContext struct { - context.Context + context.Context //nolint:containedctx Client client.Client GuestClient client.Client Namespace string