From f5cf3ff4b5b317ecca4d94b171012bd4a23880c2 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Fri, 9 Feb 2024 14:10:33 -0500 Subject: [PATCH] chore: Update to go1.22.0 (#14697) --- .circleci/config.yml | 2 +- .github/workflows/govulncheck.yml | 2 +- Makefile | 4 ++-- README.md | 2 +- go.mod | 2 +- scripts/ci.docker | 2 +- scripts/installgo_linux.sh | 5 +++-- scripts/installgo_mac.sh | 7 ++++--- scripts/installgo_windows.sh | 3 ++- testutil/tls.go | 2 +- 10 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02b744532..1025a6767 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ executors: working_directory: '/go/src/github.com/influxdata/telegraf' resource_class: large docker: - - image: 'quay.io/influxdb/telegraf-ci:1.21.6' + - image: 'quay.io/influxdb/telegraf-ci:1.22.0' environment: GOFLAGS: -p=4 mac: diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index f6649475b..7596ee795 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -15,5 +15,5 @@ jobs: - name: Scan for Vulnerabilities in Code uses: golang/govulncheck-action@v1 with: - go-version-input: 1.21.6 + go-version-input: 1.22.0 go-package: ./... diff --git a/Makefile b/Makefile index 9b6a76010..0366c048c 100644 --- a/Makefile +++ b/Makefile @@ -249,8 +249,8 @@ plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl .PHONY: ci ci: - docker build -t quay.io/influxdb/telegraf-ci:1.21.6 - < scripts/ci.docker - docker push quay.io/influxdb/telegraf-ci:1.21.6 + docker build -t quay.io/influxdb/telegraf-ci:1.22.0 - < scripts/ci.docker + docker push quay.io/influxdb/telegraf-ci:1.22.0 .PHONY: install install: $(buildbin) diff --git a/README.md b/README.md index d479014fc..4143f776c 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ sudo yum install telegraf ### Build From Source -Telegraf requires Go version 1.21 or newer and the Makefile requires GNU make. +Telegraf requires Go version 1.22 or newer and the Makefile requires GNU make. On Windows, the makefile requires the use of a bash terminal to support all makefile targets. An easy option to get bash for windows is using the version that comes with [git for windows](https://gitforwindows.org/). diff --git a/go.mod b/go.mod index 13b8ac08b..09e9c21fb 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/influxdata/telegraf -go 1.21 +go 1.22 require ( cloud.google.com/go/bigquery v1.58.0 diff --git a/scripts/ci.docker b/scripts/ci.docker index db90a4446..2da0db375 100644 --- a/scripts/ci.docker +++ b/scripts/ci.docker @@ -1,4 +1,4 @@ -FROM golang:1.21.6 +FROM golang:1.22.0 RUN chmod -R 755 "$GOPATH" diff --git a/scripts/installgo_linux.sh b/scripts/installgo_linux.sh index 8ec9a896f..4671118de 100644 --- a/scripts/installgo_linux.sh +++ b/scripts/installgo_linux.sh @@ -2,10 +2,10 @@ set -eux -GO_VERSION="1.21.6" +GO_VERSION="1.22.0" GO_ARCH="linux-amd64" # from https://golang.org/dl -GO_VERSION_SHA="3f934f40ac360b9c01f616a9aa1796d227d8b0328bf64cb045c7b8c4ee9caea4" +GO_VERSION_SHA="f6c8a87aa03b92c4b0bf3d558e28ea03006eb29db78917daec5cfb6ec1046265" # Download Go and verify Go tarball setup_go () { @@ -22,6 +22,7 @@ setup_go () { if command -v go >/dev/null 2>&1; then echo "Go is already installed" + cd v=$(go version | { read -r _ _ v _; echo "${v#go}"; }) echo "$v is installed, required version is ${GO_VERSION}" if [ "$v" != ${GO_VERSION} ]; then diff --git a/scripts/installgo_mac.sh b/scripts/installgo_mac.sh index 34255bd23..c67fe2eb2 100644 --- a/scripts/installgo_mac.sh +++ b/scripts/installgo_mac.sh @@ -3,9 +3,9 @@ set -eux ARCH=$(uname -m) -GO_VERSION="1.21.6" -GO_VERSION_SHA_arm64="0ff541fb37c38e5e5c5bcecc8f4f43c5ffd5e3a6c33a5d3e4003ded66fcfb331" # from https://golang.org/dl -GO_VERSION_SHA_amd64="31d6ecca09010ab351e51343a5af81d678902061fee871f912bdd5ef4d778850" # from https://golang.org/dl +GO_VERSION="1.22.0" +GO_VERSION_SHA_arm64="bf8e388b09134164717cd52d3285a4ab3b68691b80515212da0e9f56f518fb1e" # from https://golang.org/dl +GO_VERSION_SHA_amd64="ebca81df938d2d1047cc992be6c6c759543cf309d401b86af38a6aed3d4090f4" # from https://golang.org/dl if [ "$ARCH" = 'arm64' ]; then GO_ARCH="darwin-arm64" @@ -38,6 +38,7 @@ setup_go () { if command -v go >/dev/null 2>&1; then echo "Go is already installed" + cd v=$(go version | { read -r _ _ v _; echo "${v#go}"; }) echo "$v is installed, required version is ${GO_VERSION}" if [ "$v" != ${GO_VERSION} ]; then diff --git a/scripts/installgo_windows.sh b/scripts/installgo_windows.sh index 9a826a610..0292a7684 100644 --- a/scripts/installgo_windows.sh +++ b/scripts/installgo_windows.sh @@ -2,7 +2,7 @@ set -eux -GO_VERSION="1.21.6" +GO_VERSION="1.22.0" setup_go () { choco upgrade golang --allow-downgrade --version=${GO_VERSION} @@ -10,6 +10,7 @@ setup_go () { if command -v go >/dev/null 2>&1; then echo "Go is already installed" + cd v=$(go version | { read -r _ _ v _; echo "${v#go}"; }) echo "$v is installed, required version is ${GO_VERSION}" if [ "$v" != ${GO_VERSION} ]; then diff --git a/testutil/tls.go b/testutil/tls.go index 30cfd114f..0605e6933 100644 --- a/testutil/tls.go +++ b/testutil/tls.go @@ -61,7 +61,7 @@ func (p *pki) TLSMinVersion() string { } func (p *pki) TLSMaxVersion() string { - return "TLS12" + return "TLS13" } func (p *pki) ReadClientCert() string {