diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 99f6ee6..f9d4cf6 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -1,4 +1,4 @@ -FROM registry.suse.com/bci/golang:1.22.7 +FROM registry.suse.com/bci/golang:1.23 ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH @@ -15,7 +15,7 @@ RUN export K8S_VERSION=1.24.2 && \ tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz ## install golangci -RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1 +RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.63.4 # The docker version in dapper is too old to have buildx. Install it manually. RUN curl -sSfL https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} -o buildx-v0.13.1.linux-${ARCH} && \ diff --git a/go.mod b/go.mod index 7ac4dc4..d51cfed 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/harvester/pcidevices -go 1.22.7 +go 1.23.4 require ( github.com/evanphx/json-patch v5.6.0+incompatible @@ -155,7 +155,7 @@ require ( golang.org/x/net v0.21.0 golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.18.0 golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect diff --git a/pkg/controller/usbdevice/usbdevice_controller.go b/pkg/controller/usbdevice/usbdevice_controller.go index ce12e2a..78658a8 100644 --- a/pkg/controller/usbdevice/usbdevice_controller.go +++ b/pkg/controller/usbdevice/usbdevice_controller.go @@ -238,7 +238,7 @@ func (h *DevHandler) getList(localUSBDevices map[int][]*deviceplugins.USBDevice, ResourceName: resourceName(name), NodeName: nodeName, DevicePath: localUSBDevice.DevicePath, - Description: usbid.DescribeWithVendorAndProduct(gousb.ID(localUSBDevice.Vendor), gousb.ID(localUSBDevice.Product)), + Description: usbid.DescribeWithVendorAndProduct(gousb.ID(localUSBDevice.Vendor), gousb.ID(localUSBDevice.Product)), // nolint:gosec PCIAddress: localUSBDevice.PCIAddress, }, } @@ -252,7 +252,7 @@ func (h *DevHandler) getList(localUSBDevices map[int][]*deviceplugins.USBDevice, ResourceName: resourceName(usbDeviceName(nodeName, localUSBDevice)), NodeName: nodeName, DevicePath: localUSBDevice.DevicePath, - Description: usbid.DescribeWithVendorAndProduct(gousb.ID(localUSBDevice.Vendor), gousb.ID(localUSBDevice.Product)), + Description: usbid.DescribeWithVendorAndProduct(gousb.ID(localUSBDevice.Vendor), gousb.ID(localUSBDevice.Product)), // nolint:gosec PCIAddress: localUSBDevice.PCIAddress, } updateList = append(updateList, existedCp) diff --git a/pkg/util/gousb/usbid/describe_test.go b/pkg/util/gousb/usbid/describe_test.go index 64e557d..adcddcd 100644 --- a/pkg/util/gousb/usbid/describe_test.go +++ b/pkg/util/gousb/usbid/describe_test.go @@ -24,7 +24,7 @@ func TestDescribeWithVendorAndProduct(t *testing.T) { vendor, _ := strconv.ParseInt(tc.vendor, 16, 64) product, _ := strconv.ParseInt(tc.product, 16, 64) - output := DescribeWithVendorAndProduct(gousb.ID(vendor), gousb.ID(product)) + output := DescribeWithVendorAndProduct(gousb.ID(vendor), gousb.ID(product)) // nolint:gosec assert.Equal(t, tc.expected, output) } diff --git a/pkg/util/gousb/usbid/parse.go b/pkg/util/gousb/usbid/parse.go index 486be87..328ecec 100644 --- a/pkg/util/gousb/usbid/parse.go +++ b/pkg/util/gousb/usbid/parse.go @@ -130,7 +130,7 @@ func (p *Parser) split(s string) (kind string, level int, id uint64, name string } func (p *Parser) parseVendor(level int, raw uint64, name string) error { - id := gousb.ID(raw) + id := gousb.ID(raw) // nolint:gosec switch level { case 0: @@ -175,7 +175,7 @@ func (p *Parser) parseClass(level int, id uint64, name string) error { p.class = &Class{ Name: name, } - p.classes[gousb.Class(id)] = p.class + p.classes[gousb.Class(id)] = p.class // nolint:gosec case 1: if p.class == nil { @@ -188,7 +188,7 @@ func (p *Parser) parseClass(level int, id uint64, name string) error { if p.class.SubClass == nil { p.class.SubClass = make(map[gousb.Class]*SubClass) } - p.class.SubClass[gousb.Class(id)] = p.subclass + p.class.SubClass[gousb.Class(id)] = p.subclass // nolint:gosec case 2: if p.subclass == nil { @@ -198,7 +198,7 @@ func (p *Parser) parseClass(level int, id uint64, name string) error { if p.subclass.Protocol == nil { p.subclass.Protocol = make(map[gousb.Protocol]string) } - p.subclass.Protocol[gousb.Protocol(id)] = name + p.subclass.Protocol[gousb.Protocol(id)] = name // nolint:gosec default: return fmt.Errorf("too many levels of nesting for class")