diff --git a/.github/workflows/lib-validate.yaml b/.github/workflows/lib-validate.yaml index ec0ac9e0a..bf3646e27 100644 --- a/.github/workflows/lib-validate.yaml +++ b/.github/workflows/lib-validate.yaml @@ -41,7 +41,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.52.1 + version: v1.55.2 args: -v --timeout 5m build: diff --git a/.golangci.yml b/.golangci.yml index da9285c1e..93b28bbfa 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -51,6 +51,8 @@ linters-settings: simplify: true golint: min-confidence: 0.9 + goconst: + ignore-tests: true govet: check-shadowing: true enable: diff --git a/Makefile b/Makefile index e10541e6a..3f9b8a5d0 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ EXTRA_BUILD_ARGS ?= "" CERT_MANAGER_VERSION ?= v1.13.2 CONTROLLER_GEN_VERSION ?= v0.13.0 -GOLANGCI_LINT_VERSION ?= v1.54.2 +GOLANGCI_LINT_VERSION ?= v1.55.2 KIND_VERSION ?= v0.20.0 GOLICENSES_VERSION ?= v1.6.0 # Default bundle image tag diff --git a/cmd/gpu_plugin/gpu_plugin.go b/cmd/gpu_plugin/gpu_plugin.go index e8687d866..50ee1fab9 100644 --- a/cmd/gpu_plugin/gpu_plugin.go +++ b/cmd/gpu_plugin/gpu_plugin.go @@ -300,7 +300,7 @@ func newDevicePlugin(sysfsDir, devfsDir string, options cliOptions) *devicePlugi } if _, err := os.ReadDir(dp.bypathDir); err != nil { - klog.Warningf("failed to read by-path dir: $+v", err) + klog.Warningf("failed to read by-path dir: %+v", err) dp.bypathFound = false } diff --git a/demo/sgx-sdk-demo/Dockerfile b/demo/sgx-sdk-demo/Dockerfile index 2f9a31687..66a747b11 100644 --- a/demo/sgx-sdk-demo/Dockerfile +++ b/demo/sgx-sdk-demo/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && \ # SGX SDK is installed in /opt/intel directory. WORKDIR /opt/intel -ARG DCAP_VERSION=DCAP_1.18 +ARG DCAP_VERSION=DCAP_1.19 RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main" | \ tee -a /etc/apt/sources.list.d/intel-sgx.list \ @@ -37,7 +37,7 @@ RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://d libsgx-quote-ex-dev # Install SGX SDK -ARG SGX_SDK_URL=https://download.01.org/intel-sgx/sgx-linux/2.21/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.21.100.1.bin +ARG SGX_SDK_URL=https://download.01.org/intel-sgx/sgx-linux/2.22/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.22.100.3.bin RUN wget ${SGX_SDK_URL} \ && export SGX_SDK_INSTALLER=$(basename $SGX_SDK_URL) \ && chmod +x $SGX_SDK_INSTALLER \ diff --git a/pkg/fpga/bitstream/bitstream.go b/pkg/fpga/bitstream/bitstream.go index d95a7e7eb..a59e2832e 100644 --- a/pkg/fpga/bitstream/bitstream.go +++ b/pkg/fpga/bitstream/bitstream.go @@ -24,9 +24,7 @@ import ( // GetFPGABitstream scans bitstream storage and returns first found bitstream by region and afu id. func GetFPGABitstream(bitstreamDir, region, afu string) (File, error) { bitstreamPath := "" - // Temporarily only support gbs bitstreams - // for _, ext := range []string{".gbs", ".aocx"} { - for _, ext := range []string{".gbs", ".aocx"} { + for _, ext := range []string{fileExtensionGBS, fileExtensionAOCX} { bitstreamPath = filepath.Join(bitstreamDir, region, afu+ext) _, err := os.Stat(bitstreamPath) @@ -47,9 +45,9 @@ func GetFPGABitstream(bitstreamDir, region, afu string) (File, error) { // Open bitstream file, detecting type based on the filename extension. func Open(fname string) (File, error) { switch filepath.Ext(fname) { - case ".gbs": + case fileExtensionGBS: return OpenGBS(fname) - case ".aocx": + case fileExtensionAOCX: return OpenAOCX(fname) } diff --git a/pkg/fpga/bitstream/gbs_test.go b/pkg/fpga/bitstream/gbs_test.go index 64ca7cd6c..3d5ebd553 100644 --- a/pkg/fpga/bitstream/gbs_test.go +++ b/pkg/fpga/bitstream/gbs_test.go @@ -52,7 +52,7 @@ func TestFileGBSMethods(t *testing.T) { interfaceUUID := "69528db6eb31577a8c3668f9faa081f6" typeUUID := "d8424dc4a4a3c413f89e433683f9040b" - gbs, err := OpenGBS(filepath.Join("testdata/intel.com/fpga", interfaceUUID, typeUUID) + ".gbs") + gbs, err := OpenGBS(filepath.Join("testdata/intel.com/fpga", interfaceUUID, typeUUID) + fileExtensionGBS) if err != nil { t.Errorf("unexpected open error: %+v", err) return @@ -76,7 +76,7 @@ func TestFileGBSMethods(t *testing.T) { } installPath := gbs.InstallPath("") - if installPath != filepath.Join(interfaceUUID, typeUUID)+".gbs" { + if installPath != filepath.Join(interfaceUUID, typeUUID)+fileExtensionGBS { t.Errorf("unexpected Install Path value: %s", installPath) }