rules: two places need to call EmptyLabels

Can't assume nil is a valid value.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2023-02-22 15:13:31 +00:00
parent 66da1d51fd
commit 3f7ba22bde
2 changed files with 3 additions and 3 deletions

View file

@ -919,8 +919,8 @@ func TestAlertingEvalWithOrigin(t *testing.T) {
time.Second,
time.Minute,
lbs,
nil,
nil,
labels.EmptyLabels(),
labels.EmptyLabels(),
"",
true, log.NewNopLogger(),
)

View file

@ -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
}