Skip to content

Commit

Permalink
Ignore unused parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Kitt <[email protected]>
  • Loading branch information
skitt committed Feb 15, 2024
1 parent 2f24cb5 commit 44a312b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion coredns/gateway/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (c *Controller) Start(client dynamic.Interface) error {
//nolint:wrapcheck // Let the caller wrap these errors.
c.store, c.informer = cache.NewInformer(&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
return gwClientset.List(context.TODO(), metav1.ListOptions{})
return gwClientset.List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
return gwClientset.Watch(context.TODO(), options)
Expand Down
2 changes: 1 addition & 1 deletion coredns/plugin/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func testWithFallback() {
t.mockCs.SetLocalClusterID(clusterID)

t.lh.Fall = fall.F{Zones: []string{"clusterset.local."}}
t.lh.Next = test.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
t.lh.Next = test.HandlerFunc(func(_ context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
m := new(dns.Msg)
m.SetRcode(r, dns.RcodeBadCookie)
_ = w.WriteMsg(m)
Expand Down
14 changes: 7 additions & 7 deletions coredns/plugin/setup_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var _ = Describe("Plugin setup", func() {
Resource: "submariners",
}

newDynamicClient = func(c *rest.Config) (dynamic.Interface, error) {
newDynamicClient = func(_ *rest.Config) (dynamic.Interface, error) {
return fakeClient.NewSimpleDynamicClientWithCustomListKinds(scheme.Scheme, map[schema.GroupVersionResource]string{
gatewaysGVR: "GatewayList",
submarinersGVR: "SubmarinersList",
Expand All @@ -88,7 +88,7 @@ func testCorrectConfig() {
)

BeforeEach(func() {
buildKubeConfigFunc = func(masterUrl, kubeconfigPath string) (*rest.Config, error) {
buildKubeConfigFunc = func(_, _ string) (*rest.Config, error) {
return &rest.Config{}, nil
}

Expand Down Expand Up @@ -176,7 +176,7 @@ func testIncorrectConfig() {
dummy
} noplugin`

buildKubeConfigFunc = func(masterUrl, kubeconfigPath string) (*rest.Config, error) {
buildKubeConfigFunc = func(_, _ string) (*rest.Config, error) {
return &rest.Config{}, nil
}
})
Expand All @@ -192,7 +192,7 @@ func testIncorrectConfig() {
ttl
} noplugin`

buildKubeConfigFunc = func(masterUrl, kubeconfigPath string) (*rest.Config, error) {
buildKubeConfigFunc = func(_, _ string) (*rest.Config, error) {
return &rest.Config{}, nil
}
})
Expand All @@ -208,7 +208,7 @@ func testIncorrectConfig() {
ttl -10
} noplugin`

buildKubeConfigFunc = func(masterUrl, kubeconfigPath string) (*rest.Config, error) {
buildKubeConfigFunc = func(_, _ string) (*rest.Config, error) {
return &rest.Config{}, nil
}
})
Expand All @@ -222,7 +222,7 @@ func testIncorrectConfig() {
BeforeEach(func() {
config = PluginName

buildKubeConfigFunc = func(masterUrl, kubeconfigPath string) (*rest.Config, error) {
buildKubeConfigFunc = func(_, _ string) (*rest.Config, error) {
return nil, errors.New("mock")
}
})
Expand All @@ -236,7 +236,7 @@ func testIncorrectConfig() {
func testPluginRegistration() {
When("plugin setup succeeds", func() {
It("should properly register the Lighthouse plugin with the DNS server", func() {
buildKubeConfigFunc = func(masterUrl, kubeconfigPath string) (*rest.Config, error) {
buildKubeConfigFunc = func(_, _ string) (*rest.Config, error) {
return &rest.Config{}, nil
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/agent/controller/global_ingressip_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ func newGlobalIngressIPCache(config watcher.Config) (*globalIngressIPCache, erro
Name: "GlobalIngressIP watcher",
ResourceType: GetGlobalIngressIPObj(),
Handler: watcher.EventHandlerFuncs{
OnCreateFunc: func(obj runtime.Object, numRequeues int) bool {
OnCreateFunc: func(obj runtime.Object, _ int) bool {
c.onCreateOrUpdate(obj.(*unstructured.Unstructured))
return false
},
OnUpdateFunc: func(obj runtime.Object, numRequeues int) bool {
OnUpdateFunc: func(obj runtime.Object, _ int) bool {
c.onCreateOrUpdate(obj.(*unstructured.Unstructured))
return false
},
OnDeleteFunc: func(obj runtime.Object, numRequeues int) bool {
OnDeleteFunc: func(obj runtime.Object, _ int) bool {
c.onDelete(obj.(*unstructured.Unstructured))
return false
},
Expand All @@ -72,7 +72,7 @@ func (c *globalIngressIPCache) onCreateOrUpdate(obj *unstructured.Unstructured)
}

func (c *globalIngressIPCache) onDelete(obj *unstructured.Unstructured) {
c.applyToCache(obj, func(to *sync.Map, key string, obj *unstructured.Unstructured) {
c.applyToCache(obj, func(to *sync.Map, key string, _ *unstructured.Unstructured) {
to.Delete(key)
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/controller/service_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (c *ServiceImportController) start(stopCh <-chan struct{}) error {
go func() {
<-stopCh

c.endpointControllers.Range(func(key, value interface{}) bool {
c.endpointControllers.Range(func(_, value interface{}) bool {
value.(*ServiceEndpointSliceController).stop()
return true
})
Expand Down

0 comments on commit 44a312b

Please sign in to comment.