chore: Update to go1.20 (#12593)
This commit is contained in:
parent
cde651b7ee
commit
bf108da447
|
|
@ -8,7 +8,7 @@ executors:
|
||||||
working_directory: '/go/src/github.com/influxdata/telegraf'
|
working_directory: '/go/src/github.com/influxdata/telegraf'
|
||||||
resource_class: large
|
resource_class: large
|
||||||
docker:
|
docker:
|
||||||
- image: 'quay.io/influxdb/telegraf-ci:1.19.5'
|
- image: 'quay.io/influxdb/telegraf-ci:1.20'
|
||||||
environment:
|
environment:
|
||||||
GOFLAGS: -p=4
|
GOFLAGS: -p=4
|
||||||
mac:
|
mac:
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -242,8 +242,8 @@ plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl
|
||||||
|
|
||||||
.PHONY: ci
|
.PHONY: ci
|
||||||
ci:
|
ci:
|
||||||
docker build -t quay.io/influxdb/telegraf-ci:1.19.5 - < scripts/ci.docker
|
docker build -t quay.io/influxdb/telegraf-ci:1.20 - < scripts/ci.docker
|
||||||
docker push quay.io/influxdb/telegraf-ci:1.19.5
|
docker push quay.io/influxdb/telegraf-ci:1.20
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: $(buildbin)
|
install: $(buildbin)
|
||||||
|
|
|
||||||
|
|
@ -708,7 +708,7 @@ func TestParseTimestampInvalid(t *testing.T) {
|
||||||
name: "layout not matching time",
|
name: "layout not matching time",
|
||||||
format: "rfc3339",
|
format: "rfc3339",
|
||||||
timestamp: "09.07.2019 00:11:00",
|
timestamp: "09.07.2019 00:11:00",
|
||||||
expected: "cannot parse \"7.2019 00:11:00\" as \"2006\"",
|
expected: "cannot parse \"09.07.2019 00:11:00\" as \"2006\"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "unix wrong type",
|
name: "unix wrong type",
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,10 @@ func TestGather(t *testing.T) {
|
||||||
"update_interval": 507.2,
|
"update_interval": 507.2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tests on linux with go1.20 will add a warning about code coverage
|
||||||
|
// due to the code coverage dir not being set
|
||||||
|
delete(acc.Metrics[0].Tags, "warning")
|
||||||
|
|
||||||
acc.AssertContainsTaggedFields(t, "chrony", fields, tags)
|
acc.AssertContainsTaggedFields(t, "chrony", fields, tags)
|
||||||
|
|
||||||
// test with dns lookup
|
// test with dns lookup
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.19.5
|
FROM golang:1.20
|
||||||
|
|
||||||
RUN chmod -R 755 "$GOPATH"
|
RUN chmod -R 755 "$GOPATH"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
GO_VERSION="1.19.5"
|
GO_VERSION="1.20"
|
||||||
GO_ARCH="linux-amd64"
|
GO_ARCH="linux-amd64"
|
||||||
# from https://golang.org/dl
|
# from https://golang.org/dl
|
||||||
GO_VERSION_SHA="36519702ae2fd573c9869461990ae550c8c0d955cd28d2827a6b159fda81ff95"
|
GO_VERSION_SHA="5a9ebcc65c1cce56e0d2dc616aff4c4cedcfbda8cc6f0288cc08cda3b18dcbf1"
|
||||||
|
|
||||||
# Download Go and verify Go tarball
|
# Download Go and verify Go tarball
|
||||||
setup_go () {
|
setup_go () {
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
GO_VERSION="1.19.5"
|
GO_VERSION="1.20"
|
||||||
GO_VERSION_SHA_arm64="4a67f2bf0601afe2177eb58f825adf83509511d77ab79174db0712dc9efa16c8" # from https://golang.org/dl
|
GO_VERSION_SHA_arm64="32864d6fe888714ca7b421b5997269c7f6349d7e2675c3a399133e521787608b" # from https://golang.org/dl
|
||||||
GO_VERSION_SHA_amd64="23d22bb6571bbd60197bee8aaa10e702f9802786c2e2ddce5c84527e86b66aa0" # from https://golang.org/dl
|
GO_VERSION_SHA_amd64="777025500f62d14bb5a4923072cd97431887961d24de08433a60c2fe1120531d" # from https://golang.org/dl
|
||||||
|
|
||||||
if [ "$ARCH" = 'arm64' ]; then
|
if [ "$ARCH" = 'arm64' ]; then
|
||||||
GO_ARCH="darwin-arm64"
|
GO_ARCH="darwin-arm64"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
GO_VERSION="1.19.5"
|
GO_VERSION="1.20"
|
||||||
|
|
||||||
setup_go () {
|
setup_go () {
|
||||||
choco upgrade golang --allow-downgrade --version=${GO_VERSION}
|
choco upgrade golang --allow-downgrade --version=${GO_VERSION}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue