Skip to content

Commit 1f76461

Browse files
michel-latermanmergify[bot]
authored andcommitted
Update go.mod to 1.26.2 (#6800)
* Update go.mod to 1.26.2 * Update golangci-lint version * fix fips test run * change microsoft/go fips test to use fips140=on * fix test failure * change test to check enforcement (cherry picked from commit e689116)
1 parent 6dc6c4e commit 1f76461

File tree

12 files changed

+53
-25
lines changed

12 files changed

+53
-25
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,14 @@ steps:
164164
- build/*.xml
165165
- build/coverage*.out
166166

167-
- label: ":smartbear-testexecute: Run unit tests with requirefips build tag and FIPS provider"
167+
- label: ":smartbear-testexecute: Run fips140=on unit tests with FIPS provider and microsoft/go"
168168
key: unit-test-fips-tag
169169
command: ".buildkite/scripts/unit_test.sh"
170170
env:
171171
FIPS: "true"
172172
GOEXPERIMENT: "systemcrypto"
173173
GO_DISTRO: "microsoft"
174+
GODEBUG: "fips140=on,tlsmlkem=0"
174175
agents:
175176
provider: "aws"
176177
imagePrefix: "${IMAGE_UBUNTU_X86_64_FIPS}"
@@ -179,7 +180,7 @@ steps:
179180
- build/*.xml
180181
- build/coverage*.out
181182

182-
- label: ":smartbear-testexecute: Run fips140=only unit tests with FIPS provider"
183+
- label: ":smartbear-testexecute: Run fips140=only unit tests with FIPS provider and upstream go"
183184
key: unit-test-fips140-only
184185
command: ".buildkite/scripts/unit_test_fipsonly.sh"
185186
env:

.ci/bump-golang.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,6 @@ targets:
7979
content: '{{ source "latestGoVersion" }}'
8080
file: .go-version
8181
matchpattern: '\d+.\d+.\d+'
82-
update-golang.ci:
83-
name: "Update .golangci.yml"
84-
sourceid: latestGoVersion
85-
scmid: githubConfig
86-
kind: file
87-
spec:
88-
content: '{{ source "latestGoVersion" }}'
89-
file: .golangci.yml
90-
matchpattern: '\d+.\d+.\d+'
9182
update-gomod:
9283
name: "Update go.mod"
9384
sourceid: latestGoVersion

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
4040
with:
4141
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
42-
version: v2.5.0
42+
version: v2.11.4
4343

4444
# Give the job more time to execute.
4545
# Regarding `--whole-files`, the linter is supposed to support linting of changed a patch only but,

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.25.9
1+
1.26.2

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ run:
44
timeout: 1m
55
build-tags:
66
- integration
7-
go: "1.25.9"
87

98
issues:
109
# Maximum count of issues with the same text.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: enhancement
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Update go to v1.26.2
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component: fleet-server
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
#pr: https://github.com/owner/repo/1234
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234

dev-tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/elastic/fleet-server/dev-tools
22

3-
go 1.25.9
3+
go 1.26.2
44

55
tool (
66
github.com/elastic/go-json-schema-generate/cmd/schema-generate

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/elastic/fleet-server/v7
22

3-
go 1.25.9
3+
go 1.26.2
44

55
require (
66
github.com/Pallinder/go-randomdata v1.2.0

internal/pkg/api/server_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func Test_server_ClientCert(t *testing.T) {
161161
break
162162
}
163163

164-
rCtx, rCancel := context.WithTimeout(ctx, time.Second)
164+
rCtx, rCancel := context.WithTimeout(ctx, 5*time.Second)
165165
defer rCancel()
166166
req, err := http.NewRequestWithContext(rCtx, "GET", "https://"+addr+"/api/status", nil)
167167
require.NoError(t, err)
@@ -233,7 +233,7 @@ func Test_server_ClientCert(t *testing.T) {
233233
break
234234
}
235235

236-
rCtx, rCancel := context.WithTimeout(ctx, time.Second)
236+
rCtx, rCancel := context.WithTimeout(ctx, 5*time.Second)
237237
defer rCancel()
238238
req, err := http.NewRequestWithContext(rCtx, "GET", "https://"+addr+"/api/status", nil)
239239
require.NoError(t, err)
@@ -306,7 +306,7 @@ func Test_server_ClientCert(t *testing.T) {
306306
break
307307
}
308308

309-
rCtx, rCancel := context.WithTimeout(ctx, time.Second)
309+
rCtx, rCancel := context.WithTimeout(ctx, 5*time.Second)
310310
defer rCancel()
311311
req, err := http.NewRequestWithContext(rCtx, "GET", "https://"+addr+"/api/status", nil)
312312
require.NoError(t, err)
@@ -388,7 +388,7 @@ key: %s`,
388388
break
389389
}
390390

391-
rCtx, rCancel := context.WithTimeout(ctx, time.Second)
391+
rCtx, rCancel := context.WithTimeout(ctx, 5*time.Second)
392392
defer rCancel()
393393
req, err := http.NewRequestWithContext(rCtx, "GET", "https://"+addr+"/api/status", nil)
394394
require.NoError(t, err)

internal/pkg/es/client_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package es
66

77
import (
88
"context"
9+
"crypto/fips140"
910
"crypto/tls"
1011
"crypto/x509"
1112
_ "embed"
@@ -19,7 +20,6 @@ import (
1920
"time"
2021

2122
"github.com/elastic/elastic-agent-libs/transport/tlscommon"
22-
"github.com/elastic/fleet-server/v7/internal/pkg/build"
2323
"github.com/elastic/fleet-server/v7/internal/pkg/config"
2424
"github.com/elastic/fleet-server/v7/internal/pkg/testing/certs"
2525
"github.com/stretchr/testify/require"
@@ -205,8 +205,13 @@ func TestConnectionTLS(t *testing.T) {
205205

206206
_, err = FetchESVersion(ctx, client)
207207

208-
if build.FIPSDistribution {
209-
require.ErrorContains(t, err, "tls: internal error")
208+
if fips140.Enforced() {
209+
// When FIPS 140 is enforced (GODEBUG=fips140=only), Go's crypto
210+
// stack rejects signing with a 1024-bit RSA key. Note: fips140=on
211+
// with microsoft/go's systemcrypto backend silently falls back to
212+
// stdlib in test binaries (via UnreachableExceptTests), so only
213+
// fips140=only reliably enforces this.
214+
require.Error(t, err)
210215
} else {
211216
require.NoError(t, err)
212217
}

0 commit comments

Comments
 (0)