diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index afb6e84dca5..d85cf43113a 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -196,7 +196,7 @@ steps: artifact_paths: - "build/TEST-go-unit.cov" agents: - image: "golang:1.22.6" + image: "golang:1.23.6" depends_on: - unit-tests - extended-windows diff --git a/.github/workflows/bump-agent-versions.yml b/.github/workflows/bump-agent-versions.yml index a3d77f077d9..3a753033e63 100644 --- a/.github/workflows/bump-agent-versions.yml +++ b/.github/workflows/bump-agent-versions.yml @@ -24,7 +24,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version-file: 'go.mod' - name: Set git config run: | diff --git a/.go-version b/.go-version index 2560439f071..d8c40e539ce 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.22.12 +1.23.6 diff --git a/.golangci.yml b/.golangci.yml index e4191f481bf..5dcd1f5bd51 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -118,10 +118,6 @@ linters-settings: - github.com/fsnotify/fsnotify - github.com/openshift/api - gosimple: - # Select the Go version to target. The default is '1.13'. - go: "1.22.12" - nolintlint: # Enable to ensure that nolint directives are all used. Default is true. allow-unused: false @@ -135,19 +131,11 @@ linters-settings: require-specific: false staticcheck: - # Select the Go version to target. The default is '1.13'. - go: "1.22.12" checks: ["all"] stylecheck: - # Select the Go version to target. The default is '1.13'. - go: "1.22.12" checks: ["all"] - unused: - # Select the Go version to target. The default is '1.13'. - go: "1.22.12" - gosec: excludes: - G306 # Expect WriteFile permissions to be 0600 or less diff --git a/.tool-versions b/.tool-versions index 1d08234864f..0ad3edeffba 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ mage 1.14.0 -golang 1.22.9 -terraform 1.9.3 \ No newline at end of file +golang 1.23.6 +terraform 1.9.3 diff --git a/Dockerfile b/Dockerfile index d14b635a4dd..a5ca57727aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.22.12 +ARG GO_VERSION=1.23.6 FROM circleci/golang:${GO_VERSION} @@ -7,7 +7,6 @@ ARG TEST_RESULTS=/tmp/test-results RUN mkdir -p ${TEST_RESULTS} && mkdir -p ./code RUN go get github.com/magefile/mage -ENV GO111MODULE=on WORKDIR ./code #COPY --chown=circleci:circleci . . COPY . . diff --git a/Dockerfile.skaffold b/Dockerfile.skaffold index 240406c9c06..f68bde19030 100644 --- a/Dockerfile.skaffold +++ b/Dockerfile.skaffold @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.22.12 +ARG GO_VERSION=1.23.6 ARG crossbuild_image="docker.elastic.co/beats-dev/golang-crossbuild" ARG AGENT_VERSION=8.9.0-SNAPSHOT ARG AGENT_IMAGE="docker.elastic.co/beats/elastic-agent" diff --git a/Makefile b/Makefile index b09cff1e74d..e45941ae274 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ check: ## check-go: download and run the go linter. .PHONY: check-go check-go: ## - Run golangci-lint - @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2 + @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.60.1 @./bin/golangci-lint run -v ## check-no-changes : Check there is no local changes. diff --git a/changelog/fragments/1723829102-Upgrade-to-Go-1.23.0.yaml b/changelog/fragments/1723829102-Upgrade-to-Go-1.23.0.yaml new file mode 100644 index 00000000000..a230b966b27 --- /dev/null +++ b/changelog/fragments/1723829102-Upgrade-to-Go-1.23.0.yaml @@ -0,0 +1,32 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: feature + +# Change summary; a 80ish characters long description of the change. +summary: Upgrade-to-Go-1.23.0 + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +#description: + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: "elastic-agent" + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +pr: https://github.com/elastic/elastic-agent/pull/5309 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/go.mod b/go.mod index f12b948a712..68acd1a11c1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/elastic/elastic-agent -go 1.22.12 +go 1.23.6 require ( github.com/Jeffail/gabs/v2 v2.6.0 diff --git a/pkg/testing/runner/runner_test.go b/pkg/testing/runner/runner_test.go index 31baf041018..87ce2ff275b 100644 --- a/pkg/testing/runner/runner_test.go +++ b/pkg/testing/runner/runner_test.go @@ -28,7 +28,7 @@ func TestNewRunner_Clean(t *testing.T) { AgentVersion: "8.10.0", StackVersion: "8.10.0-SNAPSHOT", BuildDir: filepath.Join(tmpdir, "build"), - GOVersion: "1.20.7", + GOVersion: "1.23.6", RepoDir: filepath.Join(tmpdir, "repo"), StateDir: stateDir, ExtraEnv: nil, diff --git a/version/docs/version.asciidoc b/version/docs/version.asciidoc index c1ef63c9c6d..c1bb35da5a6 100644 --- a/version/docs/version.asciidoc +++ b/version/docs/version.asciidoc @@ -3,7 +3,7 @@ // FIXME: once elastic.co docs have been switched over to use `main`, remove // the `doc-site-branch` line below as well as any references to it in the code. :doc-site-branch: master -:go-version: 1.22.12 +:go-version: 1.23.6 :release-state: unreleased :python: 3.7 :docker: 1.12