Skip to content

Commit

Permalink
ci: bump golangci-lint to v1.60.3 (#4474)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian authored Sep 5, 2024
1 parent 4e5cc7b commit c55e97a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-x86-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concurrency:
env:
GO_VERSION: ''
KIND_VERSION: v0.24.0
GOLANGCI_LINT_VERSION: 'v1.60.1'
GOLANGCI_LINT_VERSION: 'v1.60.3'
HELM_VERSION: v3.15.4
SUBMARINER_VERSION: '0.18.0'

Expand Down
9 changes: 6 additions & 3 deletions pkg/daemon/ovs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ func (csh cniServerHandler) releaseVf(podName, podNamespace, podNetns, ifName, n
ifName, vfName, podDesc, err)
}
// move VF device to host netns
if err = netlink.LinkSetNsFd(link, int(hostNS.Fd())); err != nil {
fd := int(netns.Fd()) // #nosec G115
if err = netlink.LinkSetNsFd(link, fd); err != nil {
return fmt.Errorf("failed to move container interface %s back to host namespace %s: %w",
ifName, podDesc, err)
}
Expand Down Expand Up @@ -407,7 +408,8 @@ func (csh cniServerHandler) configureContainerNic(podName, podNamespace, nicName
return nil, err
}

if err = netlink.LinkSetNsFd(containerLink, int(netns.Fd())); err != nil {
fd := int(netns.Fd()) // #nosec G115
if err = netlink.LinkSetNsFd(containerLink, fd); err != nil {
return nil, fmt.Errorf("failed to move link to netns: %w", err)
}

Expand Down Expand Up @@ -791,7 +793,8 @@ func configureNodeGwNic(portName, ip, gw string, macAddr net.HardwareAddr, mtu i
}
gwLink, err := netlink.LinkByName(util.NodeGwNic)
if err == nil {
if err = netlink.LinkSetNsFd(gwLink, int(gwNS.Fd())); err != nil {
fd := int(gwNS.Fd()) // #nosec G115
if err = netlink.LinkSetNsFd(gwLink, fd); err != nil {
klog.Errorf("failed to move link into netns: %v", err)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/speaker/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func parseRoute(route string) (string, uint32, error) {
if err != nil {
return "", 0, err
}
prefixLen = uint32(intLen)
prefixLen = uint32(intLen) // #nosec G115
}
return prefix, prefixLen, nil
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/tproxy/tproxy_tcp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ func listenTCP(device, network string, laddr *net.TCPAddr) (net.Listener, error)
}
}()

fd := int(fileDescriptorSource.Fd()) // #nosec G115
if device != "" {
if err = syscall.BindToDevice(int(fileDescriptorSource.Fd()), device); err != nil {
if err = syscall.BindToDevice(fd, device); err != nil {
return nil, &net.OpError{Op: "listen", Net: network, Source: nil, Addr: laddr, Err: fmt.Errorf("set socket option: SO_BINDTODEVICE(%s): %w", device, err)}
}
}

if err = syscall.SetsockoptInt(int(fileDescriptorSource.Fd()), syscall.SOL_IP, syscall.IP_TRANSPARENT, 1); err != nil {
if err = syscall.SetsockoptInt(fd, syscall.SOL_IP, syscall.IP_TRANSPARENT, 1); err != nil {
return nil, &net.OpError{Op: "listen", Net: network, Source: nil, Addr: laddr, Err: fmt.Errorf("set socket option: IP_TRANSPARENT: %w", err)}
}

Expand Down

0 comments on commit c55e97a

Please sign in to comment.