From a125c5ec08d51e375d6432b8c44e9d5c78f4af5c Mon Sep 17 00:00:00 2001 From: Alvaro Cabanas Date: Thu, 18 Jan 2024 17:28:34 +0100 Subject: [PATCH] Bump Go version to 1.21.6 (#1783) --- .../workflows/component_linux_harvest_test.yml | 5 ++++- .github/workflows/component_linux_unit_test.yml | 15 +++++++++++++-- build/Dockerfile | 2 +- build/ci/Dockerfile | 2 +- go.mod | 2 +- go.sum | 8 ++------ pkg/backend/identityapi/register_client_test.go | 2 +- test/databind/fargate/Dockerfile_test | 2 +- .../ansible/roles/repo-setup/vars/main.yaml | 2 +- test/proxy/Dockerfile_agent | 2 +- test/proxy/Dockerfile_collector | 2 +- tools/cdn-purge/go.mod | 2 +- tools/provision-alerts/go.mod | 2 +- tools/spin-ec2/go.mod | 2 +- 14 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/component_linux_harvest_test.yml b/.github/workflows/component_linux_harvest_test.yml index 552534642..245b6d3c1 100644 --- a/.github/workflows/component_linux_harvest_test.yml +++ b/.github/workflows/component_linux_harvest_test.yml @@ -19,7 +19,10 @@ jobs: go-version-file: 'go.mod' - name: Setup node - run: sudo apt install musl-dev + run: | + # FIXIT: This hack is done because the installed go version is not modified on the env vars + cp -f `which go` /usr/bin/go + sudo apt install musl-dev - name: Fix GOROOT to be run with sudo run: | diff --git a/.github/workflows/component_linux_unit_test.yml b/.github/workflows/component_linux_unit_test.yml index e94c5faef..ebaeb0e66 100644 --- a/.github/workflows/component_linux_unit_test.yml +++ b/.github/workflows/component_linux_unit_test.yml @@ -16,8 +16,16 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + - name: Running unit tests - run: make ci/unit-test + run: | + # FIXIT: This hack is done because the installed go version is not modified on the env vars + cp -f `which go` /usr/bin/go + make ci/unit-test - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.5 @@ -46,7 +54,10 @@ jobs: go-version-file: 'go.mod' - name: Running databind unit/integration tests - run: make databind-test + run: | + # FIXIT: This hack is done because the installed go version is not modified on the env vars + cp -f `which go` /usr/bin/go + make databind-test # this is temporary as those tests are not fixed yet continue-on-error: true diff --git a/build/Dockerfile b/build/Dockerfile index 9ebbfdf42..00623d369 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20.8-bullseye +FROM golang:1.21.6-bullseye ARG GH_VERSION='2.0.0' ARG GH_ARCH='amd64' diff --git a/build/ci/Dockerfile b/build/ci/Dockerfile index a6eff8d8c..832fc402f 100644 --- a/build/ci/Dockerfile +++ b/build/ci/Dockerfile @@ -5,7 +5,7 @@ ARG ANSIBLE_INVENTORY_FOLDER_ARG="/srv/runner/inventory/$REF_ARG" ARG ANSIBLE_INVENTORY_FILE_ARG="inventory.ec2" ARG ANSIBLE_VERSION="6.5.0" -ARG GO_VERSION="1.20.8" +ARG GO_VERSION="1.21.6" ENV REF=$REF_ARG ENV ANSIBLE_INVENTORY="$ANSIBLE_INVENTORY_FOLDER_ARG/$ANSIBLE_INVENTORY_FILE_ARG" diff --git a/go.mod b/go.mod index e0ce1a725..5c1d458aa 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/newrelic/infrastructure-agent -go 1.20 +go 1.21 require ( github.com/Microsoft/go-winio v0.6.1 diff --git a/go.sum b/go.sum index 52bb69041..7e188b762 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,7 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= @@ -236,8 +237,6 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY= -golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -271,8 +270,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -280,11 +277,10 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= diff --git a/pkg/backend/identityapi/register_client_test.go b/pkg/backend/identityapi/register_client_test.go index d97df9271..52b554ad1 100644 --- a/pkg/backend/identityapi/register_client_test.go +++ b/pkg/backend/identityapi/register_client_test.go @@ -218,7 +218,7 @@ func TestRegisterClient_RegisterEntity(t *testing.T) { } mc.On("RegisterPost", - mock.AnythingOfType("*context.emptyCtx"), + mock.Anything, "ExpectedUserAgent", "ExpectedXLicenseKey", expectedRegisterRequest, diff --git a/test/databind/fargate/Dockerfile_test b/test/databind/fargate/Dockerfile_test index 52291e4dc..c727214c8 100644 --- a/test/databind/fargate/Dockerfile_test +++ b/test/databind/fargate/Dockerfile_test @@ -1,4 +1,4 @@ -FROM golang:1.20 +FROM golang:1.21 WORKDIR /go/src/github.com/newrelic/infrastructure-agent/ diff --git a/test/packaging/ansible/roles/repo-setup/vars/main.yaml b/test/packaging/ansible/roles/repo-setup/vars/main.yaml index 9ffcf757c..b6e6f36a3 100644 --- a/test/packaging/ansible/roles/repo-setup/vars/main.yaml +++ b/test/packaging/ansible/roles/repo-setup/vars/main.yaml @@ -1,5 +1,5 @@ --- -go_version: 1.20 +go_version: 1.21 repo_endpoint: "http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/infrastructure_agent" repos_to_clean: diff --git a/test/proxy/Dockerfile_agent b/test/proxy/Dockerfile_agent index 51212d4fc..e94c5615d 100644 --- a/test/proxy/Dockerfile_agent +++ b/test/proxy/Dockerfile_agent @@ -1,4 +1,4 @@ -FROM golang:1.20 as builder +FROM golang:1.21 as builder ARG CGO_ENABLED=0 WORKDIR /go/src/github.com/newrelic/infrastructure-agent diff --git a/test/proxy/Dockerfile_collector b/test/proxy/Dockerfile_collector index f779817c8..c22818d55 100644 --- a/test/proxy/Dockerfile_collector +++ b/test/proxy/Dockerfile_collector @@ -1,4 +1,4 @@ -FROM golang:1.20 as builder +FROM golang:1.21 as builder ARG CGO_ENABLED=0 WORKDIR /go/src/github.com/newrelic/infrastructure-agent COPY . . diff --git a/tools/cdn-purge/go.mod b/tools/cdn-purge/go.mod index 27f0facef..61f38bfed 100644 --- a/tools/cdn-purge/go.mod +++ b/tools/cdn-purge/go.mod @@ -1,6 +1,6 @@ module github.com/newrelic/infrastructure-agent/tools/cdn-purge -go 1.20 +go 1.21 require github.com/aws/aws-sdk-go v1.39.0 diff --git a/tools/provision-alerts/go.mod b/tools/provision-alerts/go.mod index 9cbd84d43..5b30c27cf 100644 --- a/tools/provision-alerts/go.mod +++ b/tools/provision-alerts/go.mod @@ -1,6 +1,6 @@ module provision-alerts -go 1.20 +go 1.21 require ( github.com/stretchr/testify v1.7.0 diff --git a/tools/spin-ec2/go.mod b/tools/spin-ec2/go.mod index 4ebb4b987..3df6743a6 100644 --- a/tools/spin-ec2/go.mod +++ b/tools/spin-ec2/go.mod @@ -1,6 +1,6 @@ module spin-ec2 -go 1.20 +go 1.21 require ( github.com/spf13/cobra v1.2.1