From 9bec6b90c93ffadb29a27051bc6ae4c825986c50 Mon Sep 17 00:00:00 2001 From: PoAn Yang Date: Fri, 5 Jan 2024 12:22:30 +0800 Subject: [PATCH] fix: golangci-lint error Signed-off-by: PoAn Yang --- pkg/controller/agent/linkmonitor/controller.go | 4 ++-- pkg/controller/agent/nad/controller.go | 4 ++-- pkg/controller/agent/vlanconfig/controller.go | 4 ++-- pkg/controller/manager/clusternetwork/controller.go | 6 +++--- pkg/controller/manager/nad/controller.go | 4 ++-- pkg/controller/manager/node/controller.go | 4 ++-- pkg/controller/manager/vlanconfig/controller.go | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/controller/agent/linkmonitor/controller.go b/pkg/controller/agent/linkmonitor/controller.go index a67bfbf5..57e025de 100644 --- a/pkg/controller/agent/linkmonitor/controller.go +++ b/pkg/controller/agent/linkmonitor/controller.go @@ -53,7 +53,7 @@ func Register(ctx context.Context, management *config.Management) error { return nil } -func (h Handler) OnChange(key string, lm *networkv1.LinkMonitor) (*networkv1.LinkMonitor, error) { +func (h Handler) OnChange(_ string, lm *networkv1.LinkMonitor) (*networkv1.LinkMonitor, error) { if lm == nil || lm.DeletionTimestamp != nil { return nil, nil } @@ -80,7 +80,7 @@ func (h Handler) OnChange(key string, lm *networkv1.LinkMonitor) (*networkv1.Lin return lm, nil } -func (h Handler) OnRemove(key string, lm *networkv1.LinkMonitor) (*networkv1.LinkMonitor, error) { +func (h Handler) OnRemove(_ string, lm *networkv1.LinkMonitor) (*networkv1.LinkMonitor, error) { if lm == nil { return nil, nil } diff --git a/pkg/controller/agent/nad/controller.go b/pkg/controller/agent/nad/controller.go index c79015a2..940287dc 100644 --- a/pkg/controller/agent/nad/controller.go +++ b/pkg/controller/agent/nad/controller.go @@ -38,7 +38,7 @@ func Register(ctx context.Context, management *config.Management) error { return nil } -func (h Handler) OnChange(key string, nad *nadv1.NetworkAttachmentDefinition) (*nadv1.NetworkAttachmentDefinition, error) { +func (h Handler) OnChange(_ string, nad *nadv1.NetworkAttachmentDefinition) (*nadv1.NetworkAttachmentDefinition, error) { if nad == nil || nad.DeletionTimestamp != nil { return nil, nil } @@ -66,7 +66,7 @@ func (h Handler) OnChange(key string, nad *nadv1.NetworkAttachmentDefinition) (* return nad, nil } -func (h Handler) OnRemove(key string, nad *nadv1.NetworkAttachmentDefinition) (*nadv1.NetworkAttachmentDefinition, error) { +func (h Handler) OnRemove(_ string, nad *nadv1.NetworkAttachmentDefinition) (*nadv1.NetworkAttachmentDefinition, error) { if nad == nil { return nil, nil } diff --git a/pkg/controller/agent/vlanconfig/controller.go b/pkg/controller/agent/vlanconfig/controller.go index 296da536..4f1ff926 100644 --- a/pkg/controller/agent/vlanconfig/controller.go +++ b/pkg/controller/agent/vlanconfig/controller.go @@ -68,7 +68,7 @@ func Register(ctx context.Context, management *config.Management) error { return nil } -func (h Handler) OnChange(key string, vc *networkv1.VlanConfig) (*networkv1.VlanConfig, error) { +func (h Handler) OnChange(_ string, vc *networkv1.VlanConfig) (*networkv1.VlanConfig, error) { if vc == nil || vc.DeletionTimestamp != nil { return nil, nil } @@ -100,7 +100,7 @@ func (h Handler) OnChange(key string, vc *networkv1.VlanConfig) (*networkv1.Vlan return vc, nil } -func (h Handler) OnRemove(key string, vc *networkv1.VlanConfig) (*networkv1.VlanConfig, error) { +func (h Handler) OnRemove(_ string, vc *networkv1.VlanConfig) (*networkv1.VlanConfig, error) { if vc == nil { return nil, nil } diff --git a/pkg/controller/manager/clusternetwork/controller.go b/pkg/controller/manager/clusternetwork/controller.go index 13c5d1db..640a34fd 100644 --- a/pkg/controller/manager/clusternetwork/controller.go +++ b/pkg/controller/manager/clusternetwork/controller.go @@ -55,7 +55,7 @@ func Register(ctx context.Context, management *config.Management) error { return nil } -func (h Handler) EnsureLinkMonitor(key string, cn *networkv1.ClusterNetwork) (*networkv1.ClusterNetwork, error) { +func (h Handler) EnsureLinkMonitor(_ string, cn *networkv1.ClusterNetwork) (*networkv1.ClusterNetwork, error) { if cn == nil || cn.DeletionTimestamp != nil { return nil, nil } @@ -71,7 +71,7 @@ func (h Handler) EnsureLinkMonitor(key string, cn *networkv1.ClusterNetwork) (*n return cn, nil } -func (h Handler) DeleteLinkMonitor(key string, cn *networkv1.ClusterNetwork) (*networkv1.ClusterNetwork, error) { +func (h Handler) DeleteLinkMonitor(_ string, cn *networkv1.ClusterNetwork) (*networkv1.ClusterNetwork, error) { if cn == nil { return nil, nil } @@ -83,7 +83,7 @@ func (h Handler) DeleteLinkMonitor(key string, cn *networkv1.ClusterNetwork) (*n return cn, nil } -func (h Handler) SetNadReadyLabel(key string, cn *networkv1.ClusterNetwork) (*networkv1.ClusterNetwork, error) { +func (h Handler) SetNadReadyLabel(_ string, cn *networkv1.ClusterNetwork) (*networkv1.ClusterNetwork, error) { if cn == nil { return nil, nil } diff --git a/pkg/controller/manager/nad/controller.go b/pkg/controller/manager/nad/controller.go index 9c453bfd..da96ea7e 100644 --- a/pkg/controller/manager/nad/controller.go +++ b/pkg/controller/manager/nad/controller.go @@ -93,7 +93,7 @@ func Register(ctx context.Context, management *config.Management) error { return nil } -func (h Handler) OnChange(key string, nad *cniv1.NetworkAttachmentDefinition) (*cniv1.NetworkAttachmentDefinition, error) { +func (h Handler) OnChange(_ string, nad *cniv1.NetworkAttachmentDefinition) (*cniv1.NetworkAttachmentDefinition, error) { if nad == nil || nad.DeletionTimestamp != nil { return nil, nil } @@ -120,7 +120,7 @@ func (h Handler) OnChange(key string, nad *cniv1.NetworkAttachmentDefinition) (* return nad, nil } -func (h Handler) OnRemove(key string, nad *cniv1.NetworkAttachmentDefinition) (*cniv1.NetworkAttachmentDefinition, error) { +func (h Handler) OnRemove(_ string, nad *cniv1.NetworkAttachmentDefinition) (*cniv1.NetworkAttachmentDefinition, error) { if nad == nil { return nil, nil } diff --git a/pkg/controller/manager/node/controller.go b/pkg/controller/manager/node/controller.go index 23a79869..330af010 100644 --- a/pkg/controller/manager/node/controller.go +++ b/pkg/controller/manager/node/controller.go @@ -52,7 +52,7 @@ func Register(ctx context.Context, management *config.Management) error { return nil } -func (h Handler) OnChange(key string, node *corev1.Node) (*corev1.Node, error) { +func (h Handler) OnChange(_ string, node *corev1.Node) (*corev1.Node, error) { if node == nil || node.DeletionTimestamp != nil { return nil, nil } @@ -75,7 +75,7 @@ func (h Handler) OnChange(key string, node *corev1.Node) (*corev1.Node, error) { return node, nil } -func (h Handler) OnRemove(key string, node *corev1.Node) (*corev1.Node, error) { +func (h Handler) OnRemove(_ string, node *corev1.Node) (*corev1.Node, error) { if node == nil { return nil, nil } diff --git a/pkg/controller/manager/vlanconfig/controller.go b/pkg/controller/manager/vlanconfig/controller.go index 731a1139..d549099f 100644 --- a/pkg/controller/manager/vlanconfig/controller.go +++ b/pkg/controller/manager/vlanconfig/controller.go @@ -43,7 +43,7 @@ func Register(ctx context.Context, management *config.Management) error { return nil } -func (h Handler) EnsureClusterNetwork(key string, vc *networkv1.VlanConfig) (*networkv1.VlanConfig, error) { +func (h Handler) EnsureClusterNetwork(_ string, vc *networkv1.VlanConfig) (*networkv1.VlanConfig, error) { if vc == nil || vc.DeletionTimestamp != nil { return nil, nil } @@ -56,7 +56,7 @@ func (h Handler) EnsureClusterNetwork(key string, vc *networkv1.VlanConfig) (*ne return vc, nil } -func (h Handler) SetClusterNetworkReady(key string, vs *networkv1.VlanStatus) (*networkv1.VlanStatus, error) { +func (h Handler) SetClusterNetworkReady(_ string, vs *networkv1.VlanStatus) (*networkv1.VlanStatus, error) { if vs == nil || vs.DeletionTimestamp != nil { return nil, nil } @@ -71,7 +71,7 @@ func (h Handler) SetClusterNetworkReady(key string, vs *networkv1.VlanStatus) (* return vs, nil } -func (h Handler) SetClusterNetworkUnready(key string, vs *networkv1.VlanStatus) (*networkv1.VlanStatus, error) { +func (h Handler) SetClusterNetworkUnready(_ string, vs *networkv1.VlanStatus) (*networkv1.VlanStatus, error) { if vs == nil { return nil, nil }