From da27684e04e4b5f646c47eab12abf6470e828af3 Mon Sep 17 00:00:00 2001 From: Kaan Karakaya Date: Thu, 29 Feb 2024 14:41:51 +0100 Subject: [PATCH] Allow spec files with CRLF Signed-off-by: Kaan Karakaya --- internal/prometheus/spec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/prometheus/spec.go b/internal/prometheus/spec.go index 1935aa38..9db23bd2 100644 --- a/internal/prometheus/spec.go +++ b/internal/prometheus/spec.go @@ -30,7 +30,7 @@ func NewYAMLSpecLoader(pluginsRepo SLIPluginRepo, windowPeriod time.Duration) YA } } -var specTypeV1Regex = regexp.MustCompile(`(?m)^version: +['"]?prometheus\/v1['"]? *$`) +var specTypeV1Regex = regexp.MustCompile(`(?m)^version: +['"]?prometheus/v1['"]?\r?\n? *$`) func (y YAMLSpecLoader) IsSpecType(ctx context.Context, data []byte) bool { return specTypeV1Regex.Match(data)