diff --git a/coredns/gateway/controller.go b/coredns/gateway/controller.go index 2e67e364..4c4880c7 100644 --- a/coredns/gateway/controller.go +++ b/coredns/gateway/controller.go @@ -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) diff --git a/coredns/plugin/handler_test.go b/coredns/plugin/handler_test.go index b05d8f7d..3a02d6f2 100644 --- a/coredns/plugin/handler_test.go +++ b/coredns/plugin/handler_test.go @@ -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) diff --git a/coredns/plugin/setup_internal_test.go b/coredns/plugin/setup_internal_test.go index 9eaa581b..e7958bc2 100644 --- a/coredns/plugin/setup_internal_test.go +++ b/coredns/plugin/setup_internal_test.go @@ -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", @@ -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 } @@ -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 } }) @@ -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 } }) @@ -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 } }) @@ -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") } }) @@ -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 } diff --git a/pkg/agent/controller/global_ingressip_cache.go b/pkg/agent/controller/global_ingressip_cache.go index d5c98f86..982bb8f8 100644 --- a/pkg/agent/controller/global_ingressip_cache.go +++ b/pkg/agent/controller/global_ingressip_cache.go @@ -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 }, @@ -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) }) } diff --git a/pkg/agent/controller/service_import.go b/pkg/agent/controller/service_import.go index 32967e88..39289f51 100644 --- a/pkg/agent/controller/service_import.go +++ b/pkg/agent/controller/service_import.go @@ -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 })