From 3f7ba22bde8fd3508dbe8ab894c0209232690a7e Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 22 Feb 2023 15:13:31 +0000 Subject: [PATCH] rules: two places need to call EmptyLabels Can't assume nil is a valid value. Signed-off-by: Bryan Boreham --- rules/alerting_test.go | 4 ++-- rules/origin_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rules/alerting_test.go b/rules/alerting_test.go index 11f4f07f38..d6c0a9a154 100644 --- a/rules/alerting_test.go +++ b/rules/alerting_test.go @@ -919,8 +919,8 @@ func TestAlertingEvalWithOrigin(t *testing.T) { time.Second, time.Minute, lbs, - nil, - nil, + labels.EmptyLabels(), + labels.EmptyLabels(), "", true, log.NewNopLogger(), ) diff --git a/rules/origin_test.go b/rules/origin_test.go index f11caf2f67..dd8e47f74c 100644 --- a/rules/origin_test.go +++ b/rules/origin_test.go @@ -29,7 +29,7 @@ import ( type unknownRule struct{} func (u unknownRule) Name() string { return "" } -func (u unknownRule) Labels() labels.Labels { return nil } +func (u unknownRule) Labels() labels.Labels { return labels.EmptyLabels() } func (u unknownRule) Eval(ctx context.Context, time time.Time, queryFunc QueryFunc, url *url.URL, i int) (promql.Vector, error) { return nil, nil }