From 12aed7a3dd63eada8d6dc76b099724d950e010f0 Mon Sep 17 00:00:00 2001 From: Madhav Jivrajani Date: Mon, 30 Dec 2024 13:39:17 -0800 Subject: [PATCH] webhook: alter regex to account for x509sha1 GODEBUG removal go1.24 removes the x509sha1 GODEBUG variable, and with it the support for SHA-1 signed certs. This commit alters the regex in unit tests to account for that and prep for go1.24. Signed-off-by: Madhav Jivrajani --- staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go b/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go index 4b4357dea7f..068c6821e50 100644 --- a/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go +++ b/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook_test.go @@ -406,14 +406,14 @@ func TestTLSConfig(t *testing.T) { test: "server cert with SHA1 signature", clientCA: caCert, serverCert: append(append(sha1ServerCertInter, byte('\n')), caCertInter...), serverKey: serverKey, - errRegex: "x509: cannot verify signature: insecure algorithm SHA1-RSA \\(temporarily override with GODEBUG=x509sha1=1\\)", + errRegex: "x509: cannot verify signature: insecure algorithm SHA1-RSA", increaseSHA1SignatureWarnCounter: true, }, { test: "server cert signed by an intermediate CA with SHA1 signature", clientCA: caCert, serverCert: append(append(serverCertInterSHA1, byte('\n')), caCertInterSHA1...), serverKey: serverKey, - errRegex: "x509: cannot verify signature: insecure algorithm SHA1-RSA \\(temporarily override with GODEBUG=x509sha1=1\\)", + errRegex: "x509: cannot verify signature: insecure algorithm SHA1-RSA", increaseSHA1SignatureWarnCounter: true, }, }