Skip to content

Commit

Permalink
chore: Make golint-ci happy, and me a bit less
Browse files Browse the repository at this point in the history
Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
  • Loading branch information
viccuad committed Jul 25, 2023
1 parent 04c72ca commit 91944ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/policies/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions internal/resources/fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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{}

Expand Down

0 comments on commit 91944ce

Please sign in to comment.