chore: Update to go1.22.0 (#14697)

This commit is contained in:
Joshua Powers 2024-02-09 14:10:33 -05:00 committed by GitHub
parent 0338bd03a0
commit f5cf3ff4b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 17 additions and 14 deletions

View File

@ -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.21.6' - image: 'quay.io/influxdb/telegraf-ci:1.22.0'
environment: environment:
GOFLAGS: -p=4 GOFLAGS: -p=4
mac: mac:

View File

@ -15,5 +15,5 @@ jobs:
- name: Scan for Vulnerabilities in Code - name: Scan for Vulnerabilities in Code
uses: golang/govulncheck-action@v1 uses: golang/govulncheck-action@v1
with: with:
go-version-input: 1.21.6 go-version-input: 1.22.0
go-package: ./... go-package: ./...

View File

@ -249,8 +249,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.21.6 - < scripts/ci.docker docker build -t quay.io/influxdb/telegraf-ci:1.22.0 - < scripts/ci.docker
docker push quay.io/influxdb/telegraf-ci:1.21.6 docker push quay.io/influxdb/telegraf-ci:1.22.0
.PHONY: install .PHONY: install
install: $(buildbin) install: $(buildbin)

View File

@ -73,7 +73,7 @@ sudo yum install telegraf
### Build From Source ### 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. 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/). An easy option to get bash for windows is using the version that comes with [git for windows](https://gitforwindows.org/).

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/influxdata/telegraf module github.com/influxdata/telegraf
go 1.21 go 1.22
require ( require (
cloud.google.com/go/bigquery v1.58.0 cloud.google.com/go/bigquery v1.58.0

View File

@ -1,4 +1,4 @@
FROM golang:1.21.6 FROM golang:1.22.0
RUN chmod -R 755 "$GOPATH" RUN chmod -R 755 "$GOPATH"

View File

@ -2,10 +2,10 @@
set -eux set -eux
GO_VERSION="1.21.6" GO_VERSION="1.22.0"
GO_ARCH="linux-amd64" GO_ARCH="linux-amd64"
# from https://golang.org/dl # from https://golang.org/dl
GO_VERSION_SHA="3f934f40ac360b9c01f616a9aa1796d227d8b0328bf64cb045c7b8c4ee9caea4" GO_VERSION_SHA="f6c8a87aa03b92c4b0bf3d558e28ea03006eb29db78917daec5cfb6ec1046265"
# Download Go and verify Go tarball # Download Go and verify Go tarball
setup_go () { setup_go () {
@ -22,6 +22,7 @@ setup_go () {
if command -v go >/dev/null 2>&1; then if command -v go >/dev/null 2>&1; then
echo "Go is already installed" echo "Go is already installed"
cd
v=$(go version | { read -r _ _ v _; echo "${v#go}"; }) v=$(go version | { read -r _ _ v _; echo "${v#go}"; })
echo "$v is installed, required version is ${GO_VERSION}" echo "$v is installed, required version is ${GO_VERSION}"
if [ "$v" != ${GO_VERSION} ]; then if [ "$v" != ${GO_VERSION} ]; then

View File

@ -3,9 +3,9 @@
set -eux set -eux
ARCH=$(uname -m) ARCH=$(uname -m)
GO_VERSION="1.21.6" GO_VERSION="1.22.0"
GO_VERSION_SHA_arm64="0ff541fb37c38e5e5c5bcecc8f4f43c5ffd5e3a6c33a5d3e4003ded66fcfb331" # from https://golang.org/dl GO_VERSION_SHA_arm64="bf8e388b09134164717cd52d3285a4ab3b68691b80515212da0e9f56f518fb1e" # from https://golang.org/dl
GO_VERSION_SHA_amd64="31d6ecca09010ab351e51343a5af81d678902061fee871f912bdd5ef4d778850" # from https://golang.org/dl GO_VERSION_SHA_amd64="ebca81df938d2d1047cc992be6c6c759543cf309d401b86af38a6aed3d4090f4" # from https://golang.org/dl
if [ "$ARCH" = 'arm64' ]; then if [ "$ARCH" = 'arm64' ]; then
GO_ARCH="darwin-arm64" GO_ARCH="darwin-arm64"
@ -38,6 +38,7 @@ setup_go () {
if command -v go >/dev/null 2>&1; then if command -v go >/dev/null 2>&1; then
echo "Go is already installed" echo "Go is already installed"
cd
v=$(go version | { read -r _ _ v _; echo "${v#go}"; }) v=$(go version | { read -r _ _ v _; echo "${v#go}"; })
echo "$v is installed, required version is ${GO_VERSION}" echo "$v is installed, required version is ${GO_VERSION}"
if [ "$v" != ${GO_VERSION} ]; then if [ "$v" != ${GO_VERSION} ]; then

View File

@ -2,7 +2,7 @@
set -eux set -eux
GO_VERSION="1.21.6" GO_VERSION="1.22.0"
setup_go () { setup_go () {
choco upgrade golang --allow-downgrade --version=${GO_VERSION} choco upgrade golang --allow-downgrade --version=${GO_VERSION}
@ -10,6 +10,7 @@ setup_go () {
if command -v go >/dev/null 2>&1; then if command -v go >/dev/null 2>&1; then
echo "Go is already installed" echo "Go is already installed"
cd
v=$(go version | { read -r _ _ v _; echo "${v#go}"; }) v=$(go version | { read -r _ _ v _; echo "${v#go}"; })
echo "$v is installed, required version is ${GO_VERSION}" echo "$v is installed, required version is ${GO_VERSION}"
if [ "$v" != ${GO_VERSION} ]; then if [ "$v" != ${GO_VERSION} ]; then

View File

@ -61,7 +61,7 @@ func (p *pki) TLSMinVersion() string {
} }
func (p *pki) TLSMaxVersion() string { func (p *pki) TLSMaxVersion() string {
return "TLS12" return "TLS13"
} }
func (p *pki) ReadClientCert() string { func (p *pki) ReadClientCert() string {