From 7fe5514f8b63fdf90b4cf3e065555e182bceda13 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Braun Date: Tue, 16 Feb 2021 13:43:23 +0100 Subject: [PATCH] diff/report: fix key regexp The current regexp doesn't match all possible apis, for example `cert-manager.io`. As there is a closing `)` we can simply take everything before it. --- diff/report.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff/report.go b/diff/report.go index 4bfd830c..62765e4c 100644 --- a/diff/report.go +++ b/diff/report.go @@ -193,7 +193,7 @@ func setupTemplateReport(r *Report) { // report with template output will only have access to ReportTemplateSpec. // This function reverts parsedMetadata.String() func (t *ReportTemplateSpec) loadFromKey(key string) error { - pattern := regexp.MustCompile(`(?P[a-z0-9-]+), (?P[a-z0-9-]+), (?P\w+) \((?P[a-z0-9.]+)\)`) + pattern := regexp.MustCompile(`(?P[a-z0-9-]+), (?P[a-z0-9-]+), (?P\w+) \((?P[^)]+)\)`) matches := pattern.FindStringSubmatch(key) if len(matches) > 1 { t.Namespace = matches[1]