From 26e87ce5ce9db2df584b611b921982dd847e7133 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Thu, 25 Sep 2025 14:09:49 -0700 Subject: [PATCH] Conditionall check for ms_tls13kdf build tag --- dev-tools/packaging/testing/package_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dev-tools/packaging/testing/package_test.go b/dev-tools/packaging/testing/package_test.go index 1bdadda699b..fb5b499f94a 100644 --- a/dev-tools/packaging/testing/package_test.go +++ b/dev-tools/packaging/testing/package_test.go @@ -844,13 +844,12 @@ func checkFIPS(t *testing.T, agentPackageRootDir string) { case "-tags": foundTags = true require.Contains(t, setting.Value, "requirefips") - // the check on ms_tls13kdf is no longer needed for go >= 1.25 - // It should probably be conditioned to the output of `go version ` - // for example: - // go version elastic-agent-9.2.0-SNAPSHOT-linux-x86_64/data/elastic-agent-7b3817/components/apm-server - // elastic-agent-9.2.0-SNAPSHOT-linux-x86_64/data/elastic-agent-7b3817/components/apm-server: go1.25.1 - // - // require.Contains(t, setting.Value, "ms_tls13kdf") + + // Check if the ms_tls13kdf build tag is set only if the binary was built + // with go1.24.x (see https://github.com/microsoft/go/pull/1662). + if strings.HasPrefix(info.GoVersion, "go1.24") { + require.Contains(t, setting.Value, "ms_tls13kdf") + } continue case "GOEXPERIMENT": foundExperiment = true