Skip to content

Commit

Permalink
Merge pull request #1024 from openshift-kni/bump-golangci-lint
Browse files Browse the repository at this point in the history
bump golangci-lint to 1.61
  • Loading branch information
ffromani authored Sep 25, 2024
2 parents c58a482 + 0aa9ed9 commit 0cf04c0
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SHELL = /usr/bin/env bash -o pipefail
KUSTOMIZE_DEPLOY_DIR ?= config/default

# golangci-lint variables
GOLANGCI_LINT_VERSION=1.54.2
GOLANGCI_LINT_VERSION=1.61.0
GOLANGCI_LINT_NAME=golangci-lint-$(GOLANGCI_LINT_VERSION)-$(GOOS)-$(GOARCH)
GOLANGCI_LINT_ARTIFACT_FILE=$(GOLANGCI_LINT_NAME).tar.gz
GOLANGCI_LINT_EXEC_NAME=golangci-lint
Expand Down
7 changes: 4 additions & 3 deletions pkg/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package validation

import (
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -49,7 +50,7 @@ func MachineConfigPoolDuplicates(trees []nodegroupv1.Tree) error {
}

if len(duplicateErrors) > 0 {
return fmt.Errorf(strings.Join(duplicateErrors, "; "))
return errors.New(strings.Join(duplicateErrors, "; "))
}

return nil
Expand Down Expand Up @@ -107,7 +108,7 @@ func nodeGroupsDuplicates(nodeGroups []nropv1.NodeGroup) error {
}

if len(duplicateErrors) > 0 {
return fmt.Errorf(strings.Join(duplicateErrors, "; "))
return errors.New(strings.Join(duplicateErrors, "; "))
}

return nil
Expand All @@ -127,7 +128,7 @@ func nodeGroupMachineConfigPoolSelector(nodeGroups []nropv1.NodeGroup) error {
}

if len(selectorsErrors) > 0 {
return fmt.Errorf(strings.Join(selectorsErrors, "; "))
return errors.New(strings.Join(selectorsErrors, "; "))
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/serial/tests/non_regression.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ var _ = Describe("[serial][disruptive][scheduler] numaresources workload placeme
//calculate base load on the node
baseload, err := baseload.ForNode(fxt.Client, context.TODO(), nodeName)
Expect(err).ToNot(HaveOccurred(), "missing node load info for %q", nodeName)
klog.Infof(fmt.Sprintf("computed base load: %s", baseload))
klog.Infof("computed base load: %s", baseload)

//get nrt info of the node
klog.Infof(fmt.Sprintf("preparing node %q to fit the test case", nodeName))
klog.Infof("preparing node %q to fit the test case", nodeName)
nrtInfo, err := e2enrt.FindFromList(nrts, nodeName)
Expect(err).ToNot(HaveOccurred(), "missing NRT info for %q", nodeName)

Expand Down
6 changes: 3 additions & 3 deletions test/e2e/serial/tests/resource_accounting.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ var _ = Describe("[serial][disruptive][scheduler][resacct] numaresources workloa
//calculate base load on the node
baseload, err := intbaseload.ForNode(fxt.Client, context.TODO(), nodeName)
Expect(err).ToNot(HaveOccurred(), "missing node load info for %q", nodeName)
klog.Infof(fmt.Sprintf("computed base load: %s", baseload))
klog.Infof("computed base load: %s", baseload)

//get nrt info of the node
klog.Infof(fmt.Sprintf("preparing node %q to fit the test case", nodeName))
klog.Infof("preparing node %q to fit the test case", nodeName)
nrtInfo, err := e2enrt.FindFromList(nrtCandidates, nodeName)
Expect(err).ToNot(HaveOccurred(), "missing NRT info for %q", nodeName)

Expand Down Expand Up @@ -520,7 +520,7 @@ var _ = Describe("[serial][disruptive][scheduler][resacct] numaresources workloa
//calculate base load on the target node
baseload, err := intbaseload.ForNode(fxt.Client, context.TODO(), targetNodeName)
Expect(err).ToNot(HaveOccurred(), "missing node load info for %q", targetNodeName)
klog.Infof(fmt.Sprintf("computed base load: %s", baseload))
klog.Infof("computed base load: %s", baseload)

var reqResPerNUMA []corev1.ResourceList
for _, zone := range targetNrtInitial.Zones {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/serial/tests/workload_placement.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ var _ = Describe("[serial][disruptive][scheduler] numaresources workload placeme
// calculate base load on the target node
baseload, err := intbaseload.ForNode(fxt.Client, context.TODO(), targetNodeName)
Expect(err).ToNot(HaveOccurred(), "missing node load info for %q", targetNodeName)
klog.Infof(fmt.Sprintf("computed base load: %s", baseload))
klog.Infof("computed base load: %s", baseload)

// get least available CPU and Memory on each NUMA node while taking baseload into consideration
cpus := leastAvailableResourceQtyInAllZone(*targetNrtInitial, baseload, corev1.ResourceCPU)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/serial/tests/workload_placement_tmpol.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ var _ = Describe("[serial][disruptive][scheduler] numaresources workload placeme
Expect(err).ToNot(HaveOccurred())

By("running the test pod")
klog.Infof(objects.DumpPODResourceRequirements(pod))
klog.Info(objects.DumpPODResourceRequirements(pod))

By("running the test pod")
err = fxt.Client.Create(context.TODO(), pod)
Expand Down Expand Up @@ -1393,7 +1393,7 @@ var _ = Describe("[serial][disruptive][scheduler] numaresources workload placeme
dumpNRTForNode(fxt.Client, targetNodeName, "target")

By("running the test pod")
klog.Infof(objects.DumpPODResourceRequirements(pod))
klog.Info(objects.DumpPODResourceRequirements(pod))
err := fxt.Client.Create(context.TODO(), pod)
Expect(err).ToNot(HaveOccurred())

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/serial/tests/workload_unschedulable.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,10 @@ var _ = Describe("[serial][disruptive][scheduler] numaresources workload unsched
//calculate base load on the node
baseload, err := intbaseload.ForNode(fxt.Client, context.TODO(), nodeName)
Expect(err).ToNot(HaveOccurred(), "missing node load info for %q", nodeName)
klog.Infof(fmt.Sprintf("computed base load: %s", baseload))
klog.Infof("computed base load: %s", baseload)

//get nrt info of the node
klog.Infof(fmt.Sprintf("preparing node %q to fit the test case", nodeName))
klog.Infof("preparing node %q to fit the test case", nodeName)
nrtInfo, err := e2enrt.FindFromList(nrtCandidates, nodeName)
Expect(err).ToNot(HaveOccurred(), "missing NRT info for %q", nodeName)

Expand Down
4 changes: 2 additions & 2 deletions test/utils/fixture/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ func SetupWithOptions(name string, nrtList nrtv1alpha2.NodeResourceTopologyList,
ok, _ := noderesourcetopologies.EqualNRTListsItems(nrtAtTestSetup, nrtList)
if !ok {
klog.Warning("WARNING! NRT MISMATCH:\n")
klog.Infof(intnrt.ListToString(nrtList.Items, "-----NRT at Suite Setup"))
klog.Infof(intnrt.ListToString(nrtAtTestSetup.Items, "-----NRT at Test Setup"))
klog.Info(intnrt.ListToString(nrtList.Items, "-----NRT at Suite Setup"))
klog.Info(intnrt.ListToString(nrtAtTestSetup.Items, "-----NRT at Test Setup"))
}
nrtList = nrtAtTestSetup
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func SaturateNodeUntilLeft(nrtInfo nrtv1alpha2.NodeResourceTopology, requiredRes
zonePadRes, err = SaturateZoneUntilLeft(zone, requiredRes, DropHostLevelResources)
}
if err != nil {
klog.Errorf(fmt.Sprintf("could not make padding pod for zone %q leaving 0 resources available.", zone.Name))
klog.Error(fmt.Sprintf("could not make padding pod for zone %q leaving 0 resources available.", zone.Name))
return nil, err
}
klog.Infof("Padding resources for zone %q: %s", zone.Name, e2ereslist.ToString(zonePadRes))
Expand Down

0 comments on commit 0cf04c0

Please sign in to comment.