Skip to content

Commit

Permalink
Merge pull request #983 from marquiz/backports/release-0.8-981
Browse files Browse the repository at this point in the history
[release-0.8] Bump builds to use Golang v1.19.6
klihub authored Feb 22, 2023
2 parents b340806 + 9c5788c commit 741b498
Showing 13 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -10,14 +10,14 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.18
go-version: 1.19
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Install golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.2

- name: Gofmt
run: make format
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ GO_FMT := gofmt
GO_CYCLO := gocyclo
GO_LINT := golint
GO_CILINT := golangci-lint
GO_VERSION ?= 1.18.9
GO_VERSION ?= 1.19.6
GOLICENSES_VERSION ?= v1.5.0

# TEST_TAGS is the set of extra build tags passed for tests.
@@ -21,7 +21,7 @@ GO_TEST := $(GO_CMD) test $(GO_PARALLEL) -tags $(TEST_TAGS)
GO_VET := $(GO_CMD) vet -tags $(TEST_TAGS)

# Disable some golangci_lint checkers for now until we have an more acceptable baseline...
GO_CILINT_CHECKERS := -D unused,staticcheck,errcheck,deadcode,structcheck,gosimple -E golint,gofmt
GO_CILINT_CHECKERS := -D unused,staticcheck,errcheck,deadcode,structcheck,gosimple -E revive,gofmt
GO_CILINT_RUNFLAGS := --build-tags $(TEST_TAGS)

# Protoc compiler and protobuf definitions we might need to recompile.
2 changes: 1 addition & 1 deletion cmd/cri-resmgr-agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.18
ARG GO_VERSION=1.19

FROM golang:${GO_VERSION}-bullseye as builder

2 changes: 1 addition & 1 deletion cmd/cri-resmgr-webhook/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.18
ARG GO_VERSION=1.19

FROM golang:${GO_VERSION}-bullseye as builder

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/intel/cri-resource-manager

go 1.18
go 1.19

require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
14 changes: 7 additions & 7 deletions pkg/apis/resmgr/generated/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pkg/apis/resmgr/generated/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/avx/collector.go
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ func NewCollector() (prometheus.Collector, error) {
progVer := spec.Programs["tracepoint__x86_fpu_regs_deactivated"].KernelVersion

if hostVer < progVer {
return nil, errors.Wrapf(err, "The host kernel version (v%s) is too old to run the AVX512 collector program. Minimum version is v%s.", kernelVersionStr(hostVer), kernelVersionStr(progVer))
return nil, errors.Wrapf(err, "The host kernel version (v%s) is too old to run the AVX512 collector program. Minimum version is v%s", kernelVersionStr(hostVer), kernelVersionStr(progVer))
}

collection, err := bpf.NewCollection(spec)
2 changes: 1 addition & 1 deletion pkg/blockio/blockio_test.go
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ import (
"github.com/intel/cri-resource-manager/pkg/testutils"
)

var knownIOSchedulers map[string]bool = map[string]bool{
var knownIOSchedulers = map[string]bool{
"bfq": true,
"cfq": true,
"deadline": true,
7 changes: 4 additions & 3 deletions pkg/cgroups/cgroupblkio.go
Original file line number Diff line number Diff line change
@@ -47,9 +47,10 @@ var blkioThrottleWriteIOPSFiles = []string{"blkio.throttle.write_iops_device"}
// Effects of Weight and Rate values in SetBlkioParameters():
// Value | Effect
// -------+-------------------------------------------------------------------
// -1 | Do not write to cgroups, value is missing
// 0 | Write to cgroups, will remove the setting as specified in cgroups blkio interface
// other | Write to cgroups, sets the value
//
// -1 | Do not write to cgroups, value is missing
// 0 | Write to cgroups, will remove the setting as specified in cgroups blkio interface
// other | Write to cgroups, sets the value
type OciBlockIOParameters struct {
Weight int64
WeightDevice OciDeviceWeights
7 changes: 4 additions & 3 deletions pkg/cpuallocator/allocator.go
Original file line number Diff line number Diff line change
@@ -633,9 +633,10 @@ func (p CPUPriority) String() string {
}

// cmpCPUSet compares two cpusets in terms of preferred cpu priority. Returns:
// > 0 if cpuset A is preferred
// < 0 if cpuset B is preferred
// 0 if cpusets A and B are equal in terms of cpu priority
//
// > 0 if cpuset A is preferred
// < 0 if cpuset B is preferred
// 0 if cpusets A and B are equal in terms of cpu priority
func (c *cpuPriorities) cmpCPUSet(csetA, csetB cpuset.CPUSet, prefer CPUPriority, cpuCnt int) int {
if prefer == PriorityNone {
return 0
Original file line number Diff line number Diff line change
@@ -707,16 +707,14 @@ func (ca *cachedAllocations) UnmarshalJSON(data []byte) error {
return nil
}

//
// Functions for calculating CFS cpu.shares and cpu.cfs_quota_us.
//
// Notes: These functions are almost verbatim taken from the kubelet
// code (from k8s.io/kubernetes/pkg/kubelet/cm/helpers_linux.go).
// Since these are exported there, we could try to import them, set the
// related feature gates (kubefeatures.CPUCFSQuotaPeriod) for ourselves
// into the desired positions (disabled most probably for now) and use
// the imported code.
//
// Notes: These functions are almost verbatim taken from the kubelet
// code (from k8s.io/kubernetes/pkg/kubelet/cm/helpers_linux.go).
// Since these are exported there, we could try to import them, set the
// related feature gates (kubefeatures.CPUCFSQuotaPeriod) for ourselves
// into the desired positions (disabled most probably for now) and use
// the imported code.
const (
MinShares = 2
SharesPerCPU = 1024
12 changes: 6 additions & 6 deletions pkg/log/log.go
Original file line number Diff line number Diff line change
@@ -193,17 +193,17 @@ func (l Level) String() string {
// setLevel sets the logging severity level.
func (log *logging) setLevel(level Level) error {
log.level = level
kThreshold := ""
threshold := ""
switch level {
case LevelDebug, LevelInfo:
kThreshold = "INFO"
threshold = "INFO"
case LevelWarn:
kThreshold = "WARNING"
threshold = "WARNING"
case LevelError, LevelPanic, LevelFatal:
kThreshold = "ERROR"
threshold = "ERROR"
}
if err := klogctl.Set("stderrthreshold", kThreshold); err != nil {
return loggerError("failed to set log level/threshold to %s: %v", kThreshold, err)
if err := klogctl.Set("stderrthreshold", threshold); err != nil {
return loggerError("failed to set log level/threshold to %s: %v", threshold, err)
}
return nil
}

0 comments on commit 741b498

Please sign in to comment.