From 2beda5f5094a6076144ee28c3f5b31e981fb5d46 Mon Sep 17 00:00:00 2001 From: changzhen Date: Wed, 28 Feb 2024 00:25:28 +0800 Subject: [PATCH] upgrade ubuntu and go version to make the ci pass Signed-off-by: changzhen --- .github/workflows/ci.yml | 8 ++--- fake/fake.go | 16 +++++----- hack/verify-staticcheck.sh | 2 +- .../multiclusteringress/eventhandlers.go | 32 +++++++++---------- .../multiclusterservice/eventhandlers.go | 24 +++++++------- .../serviceexportpropagation/eventhandlers.go | 32 +++++++++---------- 6 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad79285..67898cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,24 +14,24 @@ concurrency: jobs: golangci: name: lint - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: checkout code uses: actions/checkout@v3 - name: install Go uses: actions/setup-go@v3 with: - go-version: 1.19.5 + go-version: 1.20.11 - name: lint run: hack/verify-staticcheck.sh build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19.5 + go-version: 1.20.11 - name: Build run: go build -v ./... - name: Test diff --git a/fake/fake.go b/fake/fake.go index 7971a04..a63a01c 100644 --- a/fake/fake.go +++ b/fake/fake.go @@ -68,7 +68,7 @@ func (p *Provider) LoadBalancer() (multiclusterprovider.LoadBalancer, bool) { } // GetLoadBalancer is a stub implementation of LoadBalancer.GetLoadBalancer. -func (p *Provider) GetLoadBalancer(ctx context.Context, mci *networkingv1alpha1.MultiClusterIngress) (*networkingv1.IngressLoadBalancerStatus, bool, error) { +func (p *Provider) GetLoadBalancer(_ context.Context, mci *networkingv1alpha1.MultiClusterIngress) (*networkingv1.IngressLoadBalancerStatus, bool, error) { p.addCall("get") namespacedName := types.NamespacedName{Namespace: mci.Namespace, Name: mci.Name}.String() for name := range p.Balancers { @@ -83,7 +83,7 @@ func (p *Provider) GetLoadBalancer(ctx context.Context, mci *networkingv1alpha1. } // EnsureLoadBalancer is a stub implementation of LoadBalancer.EnsureLoadBalancer. -func (p *Provider) EnsureLoadBalancer(ctx context.Context, mci *networkingv1alpha1.MultiClusterIngress) (status *networkingv1.IngressLoadBalancerStatus, err error) { +func (p *Provider) EnsureLoadBalancer(_ context.Context, mci *networkingv1alpha1.MultiClusterIngress) (status *networkingv1.IngressLoadBalancerStatus, err error) { p.addCall("create") if p.Balancers == nil { p.Balancers = make(map[string]Balancer) @@ -113,7 +113,7 @@ func (p *Provider) EnsureLoadBalancer(ctx context.Context, mci *networkingv1alph } // UpdateLoadBalancer is a stub implementation of LoadBalancer.UpdateLoadBalancer. -func (p *Provider) UpdateLoadBalancer(ctx context.Context, mci *networkingv1alpha1.MultiClusterIngress) (status *networkingv1.IngressLoadBalancerStatus, err error) { +func (p *Provider) UpdateLoadBalancer(_ context.Context, mci *networkingv1alpha1.MultiClusterIngress) (status *networkingv1.IngressLoadBalancerStatus, err error) { p.addCall("update") namespacedName := types.NamespacedName{Namespace: mci.Namespace, Name: mci.Name}.String() lb, exist := p.Balancers[namespacedName] @@ -135,7 +135,7 @@ func (p *Provider) UpdateLoadBalancer(ctx context.Context, mci *networkingv1alph } // EnsureLoadBalancerDeleted is a stub implementation of LoadBalancer.EnsureLoadBalancerDeleted. -func (p *Provider) EnsureLoadBalancerDeleted(ctx context.Context, mci *networkingv1alpha1.MultiClusterIngress) error { +func (p *Provider) EnsureLoadBalancerDeleted(_ context.Context, mci *networkingv1alpha1.MultiClusterIngress) error { p.addCall("delete") namespacedName := types.NamespacedName{Namespace: mci.Namespace, Name: mci.Name}.String() delete(p.Balancers, namespacedName) @@ -149,7 +149,7 @@ func (p *Provider) MCSLoadBalancer() (multiclusterprovider.MCSLoadBalancer, bool } // GetMCSLoadBalancer is a stub implementation of LoadBalancer.GetMCSLoadBalancer. -func (p *Provider) GetMCSLoadBalancer(ctx context.Context, mcs *networkingv1alpha1.MultiClusterService) (status *corev1.LoadBalancerStatus, exist bool, err error) { +func (p *Provider) GetMCSLoadBalancer(_ context.Context, mcs *networkingv1alpha1.MultiClusterService) (status *corev1.LoadBalancerStatus, exist bool, err error) { p.addCall("get") namespacedName := types.NamespacedName{Namespace: mcs.Namespace, Name: mcs.Name}.String() for name := range p.MCSBalancers { @@ -164,7 +164,7 @@ func (p *Provider) GetMCSLoadBalancer(ctx context.Context, mcs *networkingv1alph } // EnsureMCSLoadBalancer is a stub implementation of LoadBalancer.EnsureMCSLoadBalancer. -func (p *Provider) EnsureMCSLoadBalancer(ctx context.Context, mcs *networkingv1alpha1.MultiClusterService) (status *corev1.LoadBalancerStatus, err error) { +func (p *Provider) EnsureMCSLoadBalancer(_ context.Context, mcs *networkingv1alpha1.MultiClusterService) (status *corev1.LoadBalancerStatus, err error) { p.addCall("create") if p.MCSBalancers == nil { p.MCSBalancers = make(map[string]MCSBalancer) @@ -192,7 +192,7 @@ func (p *Provider) EnsureMCSLoadBalancer(ctx context.Context, mcs *networkingv1a } // UpdateMCSLoadBalancer is a stub implementation of LoadBalancer.UpdateMCSLoadBalancer. -func (p *Provider) UpdateMCSLoadBalancer(ctx context.Context, mcs *networkingv1alpha1.MultiClusterService) (status *corev1.LoadBalancerStatus, err error) { +func (p *Provider) UpdateMCSLoadBalancer(_ context.Context, mcs *networkingv1alpha1.MultiClusterService) (status *corev1.LoadBalancerStatus, err error) { p.addCall("update") namespacedName := types.NamespacedName{Namespace: mcs.Namespace, Name: mcs.Name}.String() lb, exist := p.MCSBalancers[namespacedName] @@ -212,7 +212,7 @@ func (p *Provider) UpdateMCSLoadBalancer(ctx context.Context, mcs *networkingv1a } // EnsureMCSLoadBalancerDeleted is a stub implementation of LoadBalancer.EnsureMCSLoadBalancerDeleted. -func (p *Provider) EnsureMCSLoadBalancerDeleted(ctx context.Context, mcs *networkingv1alpha1.MultiClusterService) error { +func (p *Provider) EnsureMCSLoadBalancerDeleted(_ context.Context, mcs *networkingv1alpha1.MultiClusterService) error { p.addCall("delete") namespacedName := types.NamespacedName{Namespace: mcs.Namespace, Name: mcs.Name}.String() delete(p.MCSBalancers, namespacedName) diff --git a/hack/verify-staticcheck.sh b/hack/verify-staticcheck.sh index 0d857ef..8e0bae9 100755 --- a/hack/verify-staticcheck.sh +++ b/hack/verify-staticcheck.sh @@ -5,7 +5,7 @@ set -o nounset set -o pipefail REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -GOLANGCI_LINT_VER="v1.49.0" +GOLANGCI_LINT_VER="v1.55.2" cd "${REPO_ROOT}" source "hack/util.sh" diff --git a/pkg/controllers/multiclusteringress/eventhandlers.go b/pkg/controllers/multiclusteringress/eventhandlers.go index 79c78d9..e5ebbd1 100644 --- a/pkg/controllers/multiclusteringress/eventhandlers.go +++ b/pkg/controllers/multiclusteringress/eventhandlers.go @@ -37,7 +37,7 @@ type multiClusterIngressEventHandler struct { ingClassName string } -func (h *multiClusterIngressEventHandler) Create(ctx context.Context, e event.CreateEvent, queue workqueue.RateLimitingInterface) { +func (h *multiClusterIngressEventHandler) Create(_ context.Context, e event.CreateEvent, queue workqueue.RateLimitingInterface) { mci := e.Object.(*networkingv1alpha1.MultiClusterIngress) if !util.CheckIngressClassMatched(h.ctx, h.client, mci, h.ingClassName) { return @@ -48,7 +48,7 @@ func (h *multiClusterIngressEventHandler) Create(ctx context.Context, e event.Cr }}) } -func (h *multiClusterIngressEventHandler) Update(ctx context.Context, e event.UpdateEvent, queue workqueue.RateLimitingInterface) { +func (h *multiClusterIngressEventHandler) Update(_ context.Context, e event.UpdateEvent, queue workqueue.RateLimitingInterface) { mciOld := e.ObjectOld.(*networkingv1alpha1.MultiClusterIngress) mciNew := e.ObjectNew.(*networkingv1alpha1.MultiClusterIngress) if !util.CheckIngressClassMatched(h.ctx, h.client, mciNew, h.ingClassName) { @@ -68,12 +68,12 @@ func (h *multiClusterIngressEventHandler) Update(ctx context.Context, e event.Up }}) } -func (h *multiClusterIngressEventHandler) Delete(ctx context.Context, _ event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterIngressEventHandler) Delete(_ context.Context, _ event.DeleteEvent, _ workqueue.RateLimitingInterface) { // Since finalizer is added to the multiClusterIngress object, // the delete event is processed by the update event. } -func (h *multiClusterIngressEventHandler) Generic(ctx context.Context, e event.GenericEvent, queue workqueue.RateLimitingInterface) { +func (h *multiClusterIngressEventHandler) Generic(_ context.Context, e event.GenericEvent, queue workqueue.RateLimitingInterface) { mci := e.Object.(*networkingv1alpha1.MultiClusterIngress) if !util.CheckIngressClassMatched(h.ctx, h.client, mci, h.ingClassName) { return @@ -98,11 +98,11 @@ type serviceEventHandler struct { client client.Client } -func (h *serviceEventHandler) Create(ctx context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Create(_ context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedMCI(e.Object.GetNamespace(), e.Object.GetName()) } -func (h *serviceEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Update(_ context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { svcOld := e.ObjectOld.(*corev1.Service) svcNew := e.ObjectNew.(*corev1.Service) @@ -116,11 +116,11 @@ func (h *serviceEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ h.enqueueImpactedMCI(svcNew.Namespace, svcNew.Name) } -func (h *serviceEventHandler) Delete(ctx context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Delete(_ context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedMCI(e.Object.GetNamespace(), e.Object.GetName()) } -func (h *serviceEventHandler) Generic(ctx context.Context, e event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Generic(_ context.Context, e event.GenericEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedMCI(e.Object.GetNamespace(), e.Object.GetName()) } @@ -156,19 +156,19 @@ type endpointSlicesEventHandler struct { svcEventChan chan<- event.GenericEvent } -func (h *endpointSlicesEventHandler) Create(ctx context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (h *endpointSlicesEventHandler) Create(_ context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedSvc(e.Object) } -func (h *endpointSlicesEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *endpointSlicesEventHandler) Update(_ context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedSvc(e.ObjectNew) } -func (h *endpointSlicesEventHandler) Delete(ctx context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *endpointSlicesEventHandler) Delete(_ context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedSvc(e.Object) } -func (h *endpointSlicesEventHandler) Generic(ctx context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (h *endpointSlicesEventHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { } func (h *endpointSlicesEventHandler) enqueueImpactedSvc(obj client.Object) { @@ -201,11 +201,11 @@ type secretEventHandler struct { client client.Client } -func (h *secretEventHandler) Create(ctx context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (h *secretEventHandler) Create(_ context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedMCI(e.Object.GetNamespace(), e.Object.GetName()) } -func (h *secretEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *secretEventHandler) Update(_ context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { secretOld := e.ObjectOld.(*corev1.Secret) secretNew := e.ObjectNew.(*corev1.Secret) @@ -218,7 +218,7 @@ func (h *secretEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ h.enqueueImpactedMCI(secretNew.Namespace, secretNew.Name) } -func (h *secretEventHandler) Delete(ctx context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *secretEventHandler) Delete(_ context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedMCI(e.Object.GetNamespace(), e.Object.GetName()) } @@ -239,5 +239,5 @@ func (h *secretEventHandler) enqueueImpactedMCI(secretNamespace, secretName stri } } -func (h *secretEventHandler) Generic(ctx context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (h *secretEventHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { } diff --git a/pkg/controllers/multiclusterservice/eventhandlers.go b/pkg/controllers/multiclusterservice/eventhandlers.go index 49d30a9..1ab4740 100644 --- a/pkg/controllers/multiclusterservice/eventhandlers.go +++ b/pkg/controllers/multiclusterservice/eventhandlers.go @@ -29,7 +29,7 @@ var _ handler.EventHandler = (*multiClusterServiceEventHandler)(nil) type multiClusterServiceEventHandler struct { } -func (h *multiClusterServiceEventHandler) Create(ctx context.Context, e event.CreateEvent, queue workqueue.RateLimitingInterface) { +func (h *multiClusterServiceEventHandler) Create(_ context.Context, e event.CreateEvent, queue workqueue.RateLimitingInterface) { mcs := e.Object.(*networkingv1alpha1.MultiClusterService) if !util.MCSContainLoadBalanceType(mcs) { return @@ -41,7 +41,7 @@ func (h *multiClusterServiceEventHandler) Create(ctx context.Context, e event.Cr }}) } -func (h *multiClusterServiceEventHandler) Update(ctx context.Context, e event.UpdateEvent, queue workqueue.RateLimitingInterface) { +func (h *multiClusterServiceEventHandler) Update(_ context.Context, e event.UpdateEvent, queue workqueue.RateLimitingInterface) { mcsOld := e.ObjectOld.(*networkingv1alpha1.MultiClusterService) mcsNew := e.ObjectNew.(*networkingv1alpha1.MultiClusterService) if !util.MCSContainLoadBalanceType(mcsOld) && !util.MCSContainLoadBalanceType(mcsNew) { @@ -61,12 +61,12 @@ func (h *multiClusterServiceEventHandler) Update(ctx context.Context, e event.Up }}) } -func (h *multiClusterServiceEventHandler) Delete(ctx context.Context, _ event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterServiceEventHandler) Delete(_ context.Context, _ event.DeleteEvent, _ workqueue.RateLimitingInterface) { // Since finalizer is added to the MultiClusterService object, // the delete event is processed by the update event. } -func (h *multiClusterServiceEventHandler) Generic(ctx context.Context, e event.GenericEvent, queue workqueue.RateLimitingInterface) { +func (h *multiClusterServiceEventHandler) Generic(_ context.Context, e event.GenericEvent, queue workqueue.RateLimitingInterface) { queue.Add(reconcile.Request{NamespacedName: types.NamespacedName{ Namespace: e.Object.GetNamespace(), Name: e.Object.GetName(), @@ -87,11 +87,11 @@ type serviceEventHandler struct { client client.Client } -func (h *serviceEventHandler) Create(ctx context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Create(_ context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedMCS(e.Object.GetNamespace(), e.Object.GetName()) } -func (h *serviceEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Update(_ context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { svcOld := e.ObjectOld.(*corev1.Service) svcNew := e.ObjectNew.(*corev1.Service) @@ -104,11 +104,11 @@ func (h *serviceEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ h.enqueueImpactedMCS(svcNew.Namespace, svcNew.Name) } -func (h *serviceEventHandler) Delete(ctx context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Delete(_ context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedMCS(e.Object.GetNamespace(), e.Object.GetName()) } -func (h *serviceEventHandler) Generic(ctx context.Context, e event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Generic(_ context.Context, e event.GenericEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedMCS(e.Object.GetNamespace(), e.Object.GetName()) } @@ -136,19 +136,19 @@ type endpointSlicesEventHandler struct { svcEventChan chan<- event.GenericEvent } -func (h *endpointSlicesEventHandler) Create(ctx context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (h *endpointSlicesEventHandler) Create(_ context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedSvc(e.Object) } -func (h *endpointSlicesEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *endpointSlicesEventHandler) Update(_ context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedSvc(e.ObjectNew) } -func (h *endpointSlicesEventHandler) Delete(ctx context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *endpointSlicesEventHandler) Delete(_ context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedSvc(e.Object) } -func (h *endpointSlicesEventHandler) Generic(ctx context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (h *endpointSlicesEventHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { } func (h *endpointSlicesEventHandler) enqueueImpactedSvc(obj client.Object) { diff --git a/pkg/controllers/serviceexportpropagation/eventhandlers.go b/pkg/controllers/serviceexportpropagation/eventhandlers.go index b97332e..fb0e8a6 100644 --- a/pkg/controllers/serviceexportpropagation/eventhandlers.go +++ b/pkg/controllers/serviceexportpropagation/eventhandlers.go @@ -35,7 +35,7 @@ type serviceEventHandler struct { client client.Client } -func (h *serviceEventHandler) Create(ctx context.Context, e event.CreateEvent, queue workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Create(_ context.Context, e event.CreateEvent, queue workqueue.RateLimitingInterface) { mciList := &networkingv1alpha1.MultiClusterIngressList{} if err := h.client.List(h.ctx, mciList, client.InNamespace(e.Object.GetNamespace()), @@ -68,17 +68,17 @@ func (h *serviceEventHandler) Create(ctx context.Context, e event.CreateEvent, q }}) } -func (h *serviceEventHandler) Update(ctx context.Context, _ event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Update(_ context.Context, _ event.UpdateEvent, _ workqueue.RateLimitingInterface) { // We only need to create ServiceExport based on the service and propagate it to // member clusters. Therefore, we do not need to pay attention to service update. } -func (h *serviceEventHandler) Delete(ctx context.Context, _ event.DeleteEvent, queue workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Delete(_ context.Context, _ event.DeleteEvent, _ workqueue.RateLimitingInterface) { // We will add an ownerReference to the service object on the ServiceExport // object, so that cleanup will be handled by gc controller. } -func (h *serviceEventHandler) Generic(ctx context.Context, e event.GenericEvent, queue workqueue.RateLimitingInterface) { +func (h *serviceEventHandler) Generic(_ context.Context, e event.GenericEvent, queue workqueue.RateLimitingInterface) { queue.Add(reconcile.Request{ NamespacedName: types.NamespacedName{ Namespace: e.Object.GetNamespace(), @@ -104,7 +104,7 @@ type multiClusterIngressEventHandler struct { ingClassName string } -func (h *multiClusterIngressEventHandler) Create(ctx context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterIngressEventHandler) Create(_ context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { mci := e.Object.(*networkingv1alpha1.MultiClusterIngress) if !util.CheckIngressClassMatched(h.ctx, h.client, mci, h.ingClassName) { return @@ -112,7 +112,7 @@ func (h *multiClusterIngressEventHandler) Create(ctx context.Context, e event.Cr h.enqueueImpactedService(mci) } -func (h *multiClusterIngressEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterIngressEventHandler) Update(_ context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { mciOld := e.ObjectOld.(*networkingv1alpha1.MultiClusterIngress) mciNew := e.ObjectNew.(*networkingv1alpha1.MultiClusterIngress) if !util.CheckIngressClassMatched(h.ctx, h.client, mciNew, h.ingClassName) { @@ -148,7 +148,7 @@ func (h *multiClusterIngressEventHandler) Update(ctx context.Context, e event.Up } } -func (h *multiClusterIngressEventHandler) Delete(ctx context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterIngressEventHandler) Delete(_ context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { mci := e.Object.(*networkingv1alpha1.MultiClusterIngress) if !util.CheckIngressClassMatched(h.ctx, h.client, mci, h.ingClassName) { return @@ -156,7 +156,7 @@ func (h *multiClusterIngressEventHandler) Delete(ctx context.Context, e event.De h.enqueueImpactedService(mci) } -func (h *multiClusterIngressEventHandler) Generic(ctx context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterIngressEventHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { } func (h *multiClusterIngressEventHandler) enqueueImpactedService(mci *networkingv1alpha1.MultiClusterIngress) { @@ -191,11 +191,11 @@ type multiClusterServiceEventHandler struct { svcEventChan chan<- event.GenericEvent } -func (h *multiClusterServiceEventHandler) Create(ctx context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterServiceEventHandler) Create(_ context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedService(e.Object.GetNamespace(), e.Object.GetName()) } -func (h *multiClusterServiceEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterServiceEventHandler) Update(_ context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { mcsOld := e.ObjectOld.(*networkingv1alpha1.MultiClusterService) mcsNew := e.ObjectNew.(*networkingv1alpha1.MultiClusterService) @@ -209,11 +209,11 @@ func (h *multiClusterServiceEventHandler) Update(ctx context.Context, e event.Up h.enqueueImpactedService(mcsNew.Namespace, mcsNew.Name) } -func (h *multiClusterServiceEventHandler) Delete(ctx context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterServiceEventHandler) Delete(_ context.Context, e event.DeleteEvent, _ workqueue.RateLimitingInterface) { h.enqueueImpactedService(e.Object.GetNamespace(), e.Object.GetName()) } -func (h *multiClusterServiceEventHandler) Generic(ctx context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (h *multiClusterServiceEventHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { } func (h *multiClusterServiceEventHandler) enqueueImpactedService(namespace, name string) { @@ -237,7 +237,7 @@ type resourceBindingEventHandler struct { svcEventChan chan<- event.GenericEvent } -func (h *resourceBindingEventHandler) Create(ctx context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (h *resourceBindingEventHandler) Create(_ context.Context, e event.CreateEvent, _ workqueue.RateLimitingInterface) { // The distribution feature involves directly creating rb objects, // so it is necessary to care about the rb creation event. rb := e.Object.(*workv1alpha1.ResourceBinding) @@ -252,7 +252,7 @@ func (h *resourceBindingEventHandler) Create(ctx context.Context, e event.Create }}} } -func (h *resourceBindingEventHandler) Update(ctx context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (h *resourceBindingEventHandler) Update(_ context.Context, e event.UpdateEvent, _ workqueue.RateLimitingInterface) { rbOlb := e.ObjectOld.(*workv1alpha1.ResourceBinding) rbNew := e.ObjectNew.(*workv1alpha1.ResourceBinding) @@ -275,10 +275,10 @@ func (h *resourceBindingEventHandler) Update(ctx context.Context, e event.Update }}} } -func (h *resourceBindingEventHandler) Delete(ctx context.Context, _ event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (h *resourceBindingEventHandler) Delete(_ context.Context, _ event.DeleteEvent, _ workqueue.RateLimitingInterface) { // The deletion event of the resourceBinding will be // processed by the deletion event of service. } -func (h *resourceBindingEventHandler) Generic(ctx context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (h *resourceBindingEventHandler) Generic(_ context.Context, _ event.GenericEvent, _ workqueue.RateLimitingInterface) { }