From cebffa2acb0ac58af067eba7e9d630ee0e64700f Mon Sep 17 00:00:00 2001 From: Matt Boersma Date: Thu, 26 Oct 2023 09:07:54 -0600 Subject: [PATCH] Escape dots in hostname regexps --- internal/test/env/env.go | 2 +- internal/test/env/env_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/test/env/env.go b/internal/test/env/env.go index 3c0deb26798..5426eacfa53 100644 --- a/internal/test/env/env.go +++ b/internal/test/env/env.go @@ -49,7 +49,7 @@ var ( logger = record.NewLogger(record.WithThreshold(pointer.Int(1)), record.WithWriter(ginkgo.GinkgoWriter)) scheme = runtime.NewScheme() env *envtest.Environment - clusterAPIVersionRegex = regexp.MustCompile(`^(\W)sigs.k8s.io/cluster-api v(.+)`) + clusterAPIVersionRegex = regexp.MustCompile(`^(\W)sigs\.k8s\.io/cluster-api v(.+)`) ) func init() { diff --git a/internal/test/env/env_test.go b/internal/test/env/env_test.go index fae15fb53f3..5181094d556 100644 --- a/internal/test/env/env_test.go +++ b/internal/test/env/env_test.go @@ -28,5 +28,5 @@ func TestGetFilePathToCAPICRDs(t *testing.T) { _, filename, _, _ := goruntime.Caller(0) //nolint:dogsled // Ignore "declaration has 3 blank identifiers" check. root := path.Join(path.Dir(filename), "..", "..", "..") g := gomega.NewWithT(t) - g.Expect(getFilePathToCAPICRDs(root)).To(gomega.MatchRegexp("(.+)/pkg/mod/sigs.k8s.io/cluster-api@v(.+)/config/crd/bases")) + g.Expect(getFilePathToCAPICRDs(root)).To(gomega.MatchRegexp(`(.+)/pkg/mod/sigs\.k8s\.io/cluster-api@v(.+)/config/crd/bases`)) }