From bf05c4d6e1292f4e032e8175d0fdd02a33eebf80 Mon Sep 17 00:00:00 2001 From: cpanato Date: Thu, 16 May 2024 13:44:52 +0200 Subject: [PATCH] fix lints Signed-off-by: cpanato --- cloud/providerid/providerid_test.go | 4 ++-- cloud/services/compute/instances/reconcile_test.go | 2 +- cloud/services/compute/subnets/reconcile_test.go | 2 +- exp/controllers/gcpmanagedmachinepool_controller.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cloud/providerid/providerid_test.go b/cloud/providerid/providerid_test.go index 2de808b9d..7fd32400b 100644 --- a/cloud/providerid/providerid_test.go +++ b/cloud/providerid/providerid_test.go @@ -66,7 +66,7 @@ func TestProviderID_New(t *testing.T) { } for _, tc := range testCases { - t.Run(tc.testname, func(t *testing.T) { + t.Run(tc.testname, func(_ *testing.T) { providerID, err := providerid.New(tc.project, tc.location, tc.name) if tc.expectError { @@ -102,7 +102,7 @@ func TestProviderID_NewFromResourceURL(t *testing.T) { } for _, tc := range testCases { - t.Run(tc.testname, func(t *testing.T) { + t.Run(tc.testname, func(_ *testing.T) { providerID, err := providerid.NewFromResourceURL(tc.resourceURL) if tc.expectError { diff --git a/cloud/services/compute/instances/reconcile_test.go b/cloud/services/compute/instances/reconcile_test.go index bc5f46e21..cf95c4050 100644 --- a/cloud/services/compute/instances/reconcile_test.go +++ b/cloud/services/compute/instances/reconcile_test.go @@ -211,7 +211,7 @@ func TestService_createOrGetInstance(t *testing.T) { mockInstance: &cloud.MockInstances{ ProjectRouter: &cloud.SingleProjectRouter{ID: "proj-id"}, Objects: map[meta.Key]*cloud.MockInstancesObj{}, - GetHook: func(ctx context.Context, key *meta.Key, m *cloud.MockInstances, _ ...cloud.Option) (bool, *compute.Instance, error) { + GetHook: func(_ context.Context, _ *meta.Key, _ *cloud.MockInstances, _ ...cloud.Option) (bool, *compute.Instance, error) { return true, &compute.Instance{}, &googleapi.Error{Code: http.StatusBadRequest} }, }, diff --git a/cloud/services/compute/subnets/reconcile_test.go b/cloud/services/compute/subnets/reconcile_test.go index e2cec1960..9241cf486 100644 --- a/cloud/services/compute/subnets/reconcile_test.go +++ b/cloud/services/compute/subnets/reconcile_test.go @@ -111,7 +111,7 @@ func TestService_Reconcile(t *testing.T) { mockSubnetworks: &cloud.MockSubnetworks{ ProjectRouter: &cloud.SingleProjectRouter{ID: "my-proj"}, Objects: map[meta.Key]*cloud.MockSubnetworksObj{}, - GetHook: func(ctx context.Context, key *meta.Key, m *cloud.MockSubnetworks, _ ...cloud.Option) (bool, *compute.Subnetwork, error) { + GetHook: func(_ context.Context, _ *meta.Key, _ *cloud.MockSubnetworks, _ ...cloud.Option) (bool, *compute.Subnetwork, error) { return true, &compute.Subnetwork{}, &googleapi.Error{Code: http.StatusBadRequest} }, }, diff --git a/exp/controllers/gcpmanagedmachinepool_controller.go b/exp/controllers/gcpmanagedmachinepool_controller.go index 47e2b81d4..2231c70cb 100644 --- a/exp/controllers/gcpmanagedmachinepool_controller.go +++ b/exp/controllers/gcpmanagedmachinepool_controller.go @@ -81,7 +81,7 @@ func GetOwnerClusterKey(obj metav1.ObjectMeta) (*client.ObjectKey, error) { } func machinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind) handler.MapFunc { - return func(ctx context.Context, o client.Object) []reconcile.Request { + return func(_ context.Context, o client.Object) []reconcile.Request { m, ok := o.(*expclusterv1.MachinePool) if !ok { panic(fmt.Sprintf("Expected a MachinePool but got a %T", o))