Skip to content

Commit

Permalink
cpuallocator: golangci-lint fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub authored and askervin committed Dec 11, 2024
1 parent ce697f1 commit 8af4c2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions pkg/cpuallocator/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ type allocatorHelper struct {
prefer CPUPriority // CPU priority to prefer
cnt int // number of CPUs to allocate
result cpuset.CPUSet // set of CPUs allocated

pkgs []sysfs.CPUPackage // physical CPU packages, sorted by preference
cpus []sysfs.CPU // CPU cores, sorted by preference
}

// CPUAllocator is an interface for a generic CPU allocator
Expand Down Expand Up @@ -942,7 +939,6 @@ func (a *allocatorHelper) takeCacheGroups() {
a.result = result
a.from = from
a.cnt = 0
return
}

// Allocate full idle CPU cores.
Expand Down
7 changes: 3 additions & 4 deletions pkg/cpuallocator/cpuallocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package cpuallocator

import (
"io/ioutil"
"os"
"path"
"testing"
Expand All @@ -30,7 +29,7 @@ import (

func TestAllocatorHelper(t *testing.T) {
// Create tmpdir and decompress testdata there
tmpdir, err := ioutil.TempDir("", "nri-resource-policy-test-")
tmpdir, err := os.MkdirTemp("", "nri-resource-policy-test-")
if err != nil {
t.Fatalf("failed to create tmpdir: %v", err)
}
Expand Down Expand Up @@ -108,7 +107,7 @@ func TestClusteredAllocation(t *testing.T) {
}

// Create tmpdir and decompress testdata there
tmpdir, err := ioutil.TempDir("", "nri-resource-policy-test-")
tmpdir, err := os.MkdirTemp("", "nri-resource-policy-test-")
if err != nil {
t.Fatalf("failed to create tmpdir: %v", err)
}
Expand Down Expand Up @@ -324,7 +323,7 @@ func TestClusteredCoreKindAllocation(t *testing.T) {
}

// Create tmpdir and decompress testdata there
tmpdir, err := ioutil.TempDir("", "nri-resource-policy-test-")
tmpdir, err := os.MkdirTemp("", "nri-resource-policy-test-")
if err != nil {
t.Fatalf("failed to create tmpdir: %v", err)
}
Expand Down

0 comments on commit 8af4c2e

Please sign in to comment.