From 5bbabf708b9befd03b344900f4e63ef9870f396d Mon Sep 17 00:00:00 2001 From: Jesus Vazquez Date: Wed, 13 Apr 2022 16:08:16 +0200 Subject: [PATCH] Prometheus api uses grafana/regexp now When initializing v1.NewAPI we're passing a compiled Regexp that unmatches the expected type becuase we were importing "regexp" instead of "github.com/grafana/regexp". This commit makes it consistent by replacing "regexp" with "github.com/grafana/regexp" and updating go mod. Signed-off-by: Jesus Vazquez --- go.mod | 2 +- pkg/api/handlers.go | 2 +- pkg/querier/error_translate_queryable_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c14a73b6ea..28a454b455 100644 --- a/go.mod +++ b/go.mod @@ -57,6 +57,7 @@ require ( github.com/alecthomas/chroma v0.10.0 github.com/google/go-github/v32 v32.1.0 github.com/grafana-tools/sdk v0.0.0-20211220201350-966b3088eec9 + github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db gopkg.in/alecthomas/kingpin.v2 v2.2.6 @@ -138,7 +139,6 @@ require ( github.com/googleapis/gax-go/v2 v2.2.0 // indirect github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de // indirect github.com/gosimple/slug v1.1.1 // indirect - github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20201207153454-9f6bf00c00a7 // indirect github.com/hashicorp/consul/api v1.12.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect diff --git a/pkg/api/handlers.go b/pkg/api/handlers.go index 978dfafe22..844c09c7c6 100644 --- a/pkg/api/handlers.go +++ b/pkg/api/handlers.go @@ -11,12 +11,12 @@ import ( "html/template" "net/http" "path" - "regexp" "sort" "sync" "github.com/go-kit/log" "github.com/gorilla/mux" + "github.com/grafana/regexp" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" diff --git a/pkg/querier/error_translate_queryable_test.go b/pkg/querier/error_translate_queryable_test.go index 812bcf450e..e4c03563f1 100644 --- a/pkg/querier/error_translate_queryable_test.go +++ b/pkg/querier/error_translate_queryable_test.go @@ -10,11 +10,11 @@ import ( "fmt" "net/http" "net/http/httptest" - "regexp" "testing" "time" "github.com/go-kit/log" + "github.com/grafana/regexp" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/route"