Skip to content

Commit

Permalink
Escape dots in hostname regexps
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma authored and k8s-infra-cherrypick-robot committed Oct 26, 2023
1 parent 9341379 commit cebffa2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/test/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion internal/test/env/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`))
}

0 comments on commit cebffa2

Please sign in to comment.