Skip to content

Commit

Permalink
fix: golangci-lint error
Browse files Browse the repository at this point in the history
Signed-off-by: PoAn Yang <[email protected]>
  • Loading branch information
FrankYang0529 authored and starbops committed Jan 8, 2024
1 parent b7d7f97 commit 9bec6b9
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/agent/linkmonitor/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/agent/nad/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/agent/vlanconfig/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/manager/clusternetwork/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/manager/nad/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/manager/node/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/manager/vlanconfig/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit 9bec6b9

Please sign in to comment.