From 7253fcfeb3a5002eb8471bbce9404728c8724bdc Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Mon, 15 Jan 2024 08:07:14 -0700 Subject: [PATCH] chore: Update to go1.21.6 (#14559) --- .circleci/config.yml | 2 +- .github/workflows/govulncheck.yml | 2 +- Makefile | 4 ++-- scripts/ci.docker | 2 +- scripts/installgo_linux.sh | 4 ++-- scripts/installgo_mac.sh | 16 ++++++++-------- scripts/installgo_windows.sh | 2 +- tools/update_goversion/main.go | 5 ----- 8 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 43d498632..1752c5e5b 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.5' + - image: 'quay.io/influxdb/telegraf-ci:1.21.6' environment: GOFLAGS: -p=4 mac: diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 2590d2824..f6649475b 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.5 + go-version-input: 1.21.6 go-package: ./... diff --git a/Makefile b/Makefile index c5d030e9e..50b76a38b 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.5 - < scripts/ci.docker - docker push quay.io/influxdb/telegraf-ci:1.21.5 + docker build -t quay.io/influxdb/telegraf-ci:1.21.6 - < scripts/ci.docker + docker push quay.io/influxdb/telegraf-ci:1.21.6 .PHONY: install install: $(buildbin) diff --git a/scripts/ci.docker b/scripts/ci.docker index 5fcf1980b..db90a4446 100644 --- a/scripts/ci.docker +++ b/scripts/ci.docker @@ -1,4 +1,4 @@ -FROM golang:1.21.5 +FROM golang:1.21.6 RUN chmod -R 755 "$GOPATH" diff --git a/scripts/installgo_linux.sh b/scripts/installgo_linux.sh index d32853972..8ec9a896f 100644 --- a/scripts/installgo_linux.sh +++ b/scripts/installgo_linux.sh @@ -2,10 +2,10 @@ set -eux -GO_VERSION="1.21.5" +GO_VERSION="1.21.6" GO_ARCH="linux-amd64" # from https://golang.org/dl -GO_VERSION_SHA="e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e" +GO_VERSION_SHA="3f934f40ac360b9c01f616a9aa1796d227d8b0328bf64cb045c7b8c4ee9caea4" # Download Go and verify Go tarball setup_go () { diff --git a/scripts/installgo_mac.sh b/scripts/installgo_mac.sh index 21d830765..34255bd23 100644 --- a/scripts/installgo_mac.sh +++ b/scripts/installgo_mac.sh @@ -3,9 +3,9 @@ set -eux ARCH=$(uname -m) -GO_VERSION="1.21.5" -GO_VERSION_SHA_arm64="d0f8ac0c4fb3efc223a833010901d02954e3923cfe2c9a2ff0e4254a777cc9cc" # from https://golang.org/dl -GO_VERSION_SHA_amd64="a2e1d5743e896e5fe1e7d96479c0a769254aed18cf216cf8f4c3a2300a9b3923" # from https://golang.org/dl +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 if [ "$ARCH" = 'arm64' ]; then GO_ARCH="darwin-arm64" @@ -23,17 +23,17 @@ sudo mkdir -p ${path} # it is slow to update and we can't pull specific minor versions.) setup_go () { echo "installing go" - curl -L https://golang.org/dl/go${GO_VERSION}.${GO_ARCH}.tar.gz --output go${GO_VERSION}.${GO_ARCH}.tar.gz + curl -L "https://golang.org/dl/go${GO_VERSION}.${GO_ARCH}.tar.gz" --output "go${GO_VERSION}.${GO_ARCH}.tar.gz" if ! echo "${GO_VERSION_SHA} go${GO_VERSION}.${GO_ARCH}.tar.gz" | shasum --algorithm 256 --check -; then echo "Checksum failed" >&2 exit 1 fi - sudo rm -rf ${path}/go - sudo tar -C $path -xzf go${GO_VERSION}.${GO_ARCH}.tar.gz + sudo rm -rf "${path}/go" + sudo tar -C "$path" -xzf "go${GO_VERSION}.${GO_ARCH}.tar.gz" sudo mkdir -p /usr/local/bin - sudo ln -sf ${path}/go/bin/go /usr/local/bin/go - sudo ln -sf ${path}/go/bin/gofmt /usr/local/bin/gofmt + sudo ln -sf "${path}/go/bin/go" /usr/local/bin/go + sudo ln -sf "${path}/go/bin/gofmt" /usr/local/bin/gofmt } if command -v go >/dev/null 2>&1; then diff --git a/scripts/installgo_windows.sh b/scripts/installgo_windows.sh index 793488d58..9a826a610 100644 --- a/scripts/installgo_windows.sh +++ b/scripts/installgo_windows.sh @@ -2,7 +2,7 @@ set -eux -GO_VERSION="1.21.5" +GO_VERSION="1.21.6" setup_go () { choco upgrade golang --allow-downgrade --version=${GO_VERSION} diff --git a/tools/update_goversion/main.go b/tools/update_goversion/main.go index de32f1a50..29742e580 100644 --- a/tools/update_goversion/main.go +++ b/tools/update_goversion/main.go @@ -149,11 +149,6 @@ func main() { Regex: `(quay\.io\/influxdb\/telegraf-ci):(\d.\d*.\d)`, Replace: fmt.Sprintf("$1:%s", version), }, - { - FileName: ".circleci/config.yml", - Regex: `(default): (\d.\d*.\d)`, - Replace: fmt.Sprintf("$1: %s", version), - }, { FileName: ".github/workflows/govulncheck.yml", Regex: `(go-version-input).*`,