From 0237aae8b1ce40325dd1e888d090469b551d03f9 Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Wed, 14 Aug 2024 12:55:18 -0700 Subject: [PATCH] fix govet issues and pin golangci-lint version Signed-off-by: Tariq Ibrahim --- .github/workflows/ci.yaml | 2 +- controllers/object_controls.go | 2 +- tests/e2e/framework/framework.go | 2 +- validator/main.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5f7bc1fe9..232b4f31d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,7 +88,7 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v6 with: - version: latest + version: v1.60.1 args: -v --timeout 5m skip-cache: true - run: make check diff --git a/controllers/object_controls.go b/controllers/object_controls.go index cf740d3d9..9e4a97f4a 100644 --- a/controllers/object_controls.go +++ b/controllers/object_controls.go @@ -2846,7 +2846,7 @@ func transformOpenShiftDriverToolkitContainer(obj *appsv1.DaemonSet, config *gpu return nil, nil } - return nil, fmt.Errorf(fmt.Sprintf("could not find the '%s' container", name)) + return nil, fmt.Errorf("could not find the '%s' container", name) } if !n.ocpDriverToolkit.enabled { diff --git a/tests/e2e/framework/framework.go b/tests/e2e/framework/framework.go index 2e19eea32..969e674bb 100644 --- a/tests/e2e/framework/framework.go +++ b/tests/e2e/framework/framework.go @@ -190,7 +190,7 @@ func (f *Framework) AfterEach(ctx context.Context) { for namespaceKey, namespaceErr := range nsDeletionErrors { messages = append(messages, fmt.Sprintf("Couldn't delete ns: %q: %s (%#v)", namespaceKey, namespaceErr, namespaceErr)) } - e2elog.Failf(strings.Join(messages, ",")) + ginkgo.Fail(strings.Join(messages, ",")) } }() diff --git a/validator/main.go b/validator/main.go index be0a4ffe1..b63fffa7f 100644 --- a/validator/main.go +++ b/validator/main.go @@ -1031,7 +1031,7 @@ func (m *MOFED) validate() error { present, err := m.isMellanoxDevicePresent() if err != nil { - log.Errorf(err.Error()) + log.Errorf("Error trying to retrieve Mellanox device - %s\n", err.Error()) return err } if !present {