From 215d0d6433b82565b60b43dc8ca395430a48e08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Wed, 19 Mar 2025 14:17:16 +0100 Subject: [PATCH] Test adjustments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use tiny instead of base BP builder. * Decrease minimal required Go version. * Make the self-signed certificate CA==true so it works with update-ca-trust utility. Signed-off-by: Matej VaĊĦek --- pkg/builders/builders_int_test.go | 6 ++++-- pkg/builders/testdata/go-fn-with-private-deps/go.mod | 4 ++-- pkg/builders/testdata/go-fn-with-private-deps/go.sum | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/builders/builders_int_test.go b/pkg/builders/builders_int_test.go index 408e7023a6..cc222684a6 100644 --- a/pkg/builders/builders_int_test.go +++ b/pkg/builders/builders_int_test.go @@ -91,7 +91,9 @@ func createCertificate(t *testing.T) string { ski := sha1.Sum(x509.MarshalPKCS1PublicKey(&certPrivKey.PublicKey)) cert := &x509.Certificate{ - SerialNumber: randSN(), + BasicConstraintsValid: true, + IsCA: true, + SerialNumber: randSN(), // openssl hash of this subject is 712d4c9d // do not update the subject without also updating the hash referred from another places (e.g. Dockerfile) // See also: https://github.com/paketo-buildpacks/ca-certificates/blob/v1.0.1/cacerts/certs.go#L132 @@ -159,7 +161,7 @@ func buildPatchedBuilder(ctx context.Context, t *testing.T, certDir string) stri t.Fatal(err) } - dockerfile := `FROM ghcr.io/knative/builder-jammy-base:latest + dockerfile := `FROM ghcr.io/knative/builder-jammy-tiny:latest COPY 712d4c9d.0 /etc/ssl/certs/ ` diff --git a/pkg/builders/testdata/go-fn-with-private-deps/go.mod b/pkg/builders/testdata/go-fn-with-private-deps/go.mod index 8888b399cf..4792cedaa8 100644 --- a/pkg/builders/testdata/go-fn-with-private-deps/go.mod +++ b/pkg/builders/testdata/go-fn-with-private-deps/go.mod @@ -1,5 +1,5 @@ module function -go 1.23.4 +go 1.22 -require git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250312185939-e7bf19abfd77 // indirect +require git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200 // indirect diff --git a/pkg/builders/testdata/go-fn-with-private-deps/go.sum b/pkg/builders/testdata/go-fn-with-private-deps/go.sum index bb26fb82a0..db60afd9a3 100644 --- a/pkg/builders/testdata/go-fn-with-private-deps/go.sum +++ b/pkg/builders/testdata/go-fn-with-private-deps/go.sum @@ -1,2 +1,4 @@ git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250312185939-e7bf19abfd77 h1:IJ6SiucMsd0bjPwuj3VIGCHN225+0lCU1OZSmsg3Rjk= git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250312185939-e7bf19abfd77/go.mod h1:rG9yzCHOSu2zUBmaB7GEu7RBsjiJZRUP1hy26O5CLsc= +git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200 h1:moO2xbNMRhtKOUjzkXNgtv0y3k2Xo+xP9N4MagWSXe0= +git-private.127.0.0.1.sslip.io/foo.git v0.0.0-20250319130200-b1126104a200/go.mod h1:8MJdyAVONQdluGP17pXr5Lu//oVu7YHyXBE29FDEEng=