From 91944ce9bd0261056015e9daffe182b3e4fc78af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Cuadrado=20Juan?= Date: Tue, 25 Jul 2023 15:45:20 +0200 Subject: [PATCH] chore: Make golint-ci happy, and me a bit less MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: VĂ­ctor Cuadrado Juan --- internal/policies/fetcher.go | 2 +- internal/resources/fetcher_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/policies/fetcher.go b/internal/policies/fetcher.go index 744d28be..aa9a13dd 100644 --- a/internal/policies/fetcher.go +++ b/internal/policies/fetcher.go @@ -194,7 +194,7 @@ func (f *Fetcher) getAdmissionPolicies(namespace string) ([]policiesv1.Admission return policies.Items, nil } -func newClient() (client.Client, error) { //nolint +func newClient() (client.Client, error) { //nolint:ireturn config := ctrl.GetConfigOrDie() customScheme := scheme.Scheme customScheme.AddKnownTypes( diff --git a/internal/resources/fetcher_test.go b/internal/resources/fetcher_test.go index 0f8efb0a..001f8bdb 100644 --- a/internal/resources/fetcher_test.go +++ b/internal/resources/fetcher_test.go @@ -735,13 +735,13 @@ func TestLackOfPermsWhenGettingResources(t *testing.T) { // simulate lacking permissions when listing pods or namespaces. This should // make the filtering skip these resources, and produce no error dynamicClient.PrependReactor("list", "pods", - func(action clienttesting.Action) (handled bool, ret runtime.Object, err error) { + func(action clienttesting.Action) (bool, runtime.Object, error) { return true, nil, apimachineryerrors.NewForbidden(schema.GroupResource{ Resource: "pods", }, "", errors.New("reason")) }) dynamicClient.PrependReactor("list", "namespaces", - func(action clienttesting.Action) (handled bool, ret runtime.Object, err error) { + func(action clienttesting.Action) (bool, runtime.Object, error) { return true, nil, apimachineryerrors.NewForbidden(schema.GroupResource{ Resource: "namespaces", }, "", errors.New("reason")) @@ -767,7 +767,7 @@ func TestLackOfPermsWhenGettingResources(t *testing.T) { fakeClientSet := fakekubernetes.NewSimpleClientset() fakeClientSet.Resources = []*metav1.APIResourceList{&apiResourceList} - // the pairs policies,resources should be empty, as pods,namespaces have + // the pairs (policies,resources) should be empty, as (pods,namespaces) have // been skipped because of lack of permissions expectedP1 := []AuditableResources{}