From fa602207afe6b53c0610822c6492881ca1fb7455 Mon Sep 17 00:00:00 2001 From: ramonskie Date: Wed, 30 Sep 2026 19:00:07 +0200 Subject: [PATCH] Fix certs test for Go 1.27 tls error message Go 1.27 changed crypto/tls to wrap the underlying private key parse error, so tls.X509KeyPair now returns e.g. "tls: failed to parse private key: asn1: syntax error: sequence truncated" instead of the bare message. Assert on the stable error prefix rather than the exact string, matching the existing ContainSubstring style in this file. Bump the go directive/toolchain to 1.27 to match the CI build image (cloudfoundry/bbl-deployment:latest). --- certs/validator_test.go | 4 +--- go.mod | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/certs/validator_test.go b/certs/validator_test.go index d20edd1d7..5f58507c5 100644 --- a/certs/validator_test.go +++ b/certs/validator_test.go @@ -339,9 +339,7 @@ var _ = Describe("CertificateValidator", func() { It("returns an error", func() { err := certificateValidator.Validate(realCert, invalidKey, []byte{}) - expectedErr := multierror.NewMultiError("") - expectedErr.Add(errors.New("tls: failed to parse private key")) - Expect(err).To(Equal(expectedErr)) + Expect(err.Error()).To(ContainSubstring("tls: failed to parse private key")) }) }) diff --git a/go.mod b/go.mod index 8e42dac58..ad9cfdb83 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/cloudfoundry/bosh-bootloader -go 1.24.0 +go 1.27.0 -toolchain go1.24.1 +toolchain go1.27.1 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0