Update build

* Update Go to 1.20
* Update golangci-lint.
* Update CI orb.
* Fix staticcheck issue in perf collector.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2023-03-07 17:47:48 +01:00
parent 2f20a9bb3c
commit 3691cb9faf
No known key found for this signature in database
GPG Key ID: C646B23C9E3245F1
6 changed files with 9 additions and 18 deletions

View File

@ -1,13 +1,13 @@
---
version: 2.1
orbs:
prometheus: prometheus/prometheus@0.16.0
prometheus: prometheus/prometheus@0.17.1
executors:
# Whenever the Go version is updated here, .promu.yml and .promu-cgo.yml
# should also be updated.
golang:
docker:
- image: cimg/go:1.19
- image: cimg/go:1.20
arm:
machine:
image: ubuntu-2004:current

View File

@ -18,13 +18,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.20.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@v3.2.0
uses: golangci/golangci-lint-action@v3.4.0
with:
version: v1.45.2
version: v1.51.2

View File

@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here, .circle/config.yml and
# .promu.yml should also be updated.
version: 1.19
version: 1.20
cgo: true
repository:
path: github.com/prometheus/node_exporter

View File

@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here, .circle/config.yml and
# .promu-cgo.yml should also be updated.
version: 1.19
version: 1.20
repository:
path: github.com/prometheus/node_exporter
build:

View File

@ -707,9 +707,6 @@ func (c *perfCollector) updateHardwareStats(ch chan<- prometheus.Metric) error {
if err := (*profiler).Profile(hwProfile); err != nil {
return err
}
if hwProfile == nil {
continue
}
cpuid := strconv.Itoa(c.hwProfilerCPUMap[profiler])
@ -795,9 +792,6 @@ func (c *perfCollector) updateSoftwareStats(ch chan<- prometheus.Metric) error {
if err := (*profiler).Profile(swProfile); err != nil {
return err
}
if swProfile == nil {
continue
}
cpuid := strconv.Itoa(c.swProfilerCPUMap[profiler])
@ -851,9 +845,6 @@ func (c *perfCollector) updateCacheStats(ch chan<- prometheus.Metric) error {
if err := (*profiler).Profile(cacheProfile); err != nil {
return err
}
if cacheProfile == nil {
continue
}
cpuid := strconv.Itoa(c.cacheProfilerCPUMap[profiler])

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/prometheus/node_exporter
go 1.18
go 1.19
require (
github.com/alecthomas/kingpin/v2 v2.3.2-0.20230301032407-649b5a2df7c0