Skip to content

Commit f824d31

Browse files
committed
Fixing test when labels values are not found -> return nil instead of empty array
Signed-off-by: Alan Protasio <alanprot@gmail.com>
1 parent 8cf8e29 commit f824d31

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/querier/blocks_store_queryable.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func (q *blocksStoreQuerier) LabelNames(ctx context.Context, matchers ...*labels
345345

346346
var (
347347
resMtx sync.Mutex
348-
resNameSet = []string{}
348+
resNameSet []string
349349
resWarnings = annotations.Annotations(nil)
350350
convertedMatchers = convertMatchersToLabelMatcher(matchers)
351351
)
@@ -383,7 +383,7 @@ func (q *blocksStoreQuerier) LabelValues(ctx context.Context, name string, match
383383
minT, maxT := q.minT, q.maxT
384384

385385
var (
386-
resValueSets = []string{}
386+
resValuesSet []string
387387
resWarnings = annotations.Annotations(nil)
388388

389389
resultMtx sync.Mutex
@@ -396,7 +396,7 @@ func (q *blocksStoreQuerier) LabelValues(ctx context.Context, name string, match
396396
}
397397

398398
resultMtx.Lock()
399-
resValueSets = strutil.MergeSlices(resValueSets, valueSets)
399+
resValuesSet = strutil.MergeSlices(resValuesSet, valueSets)
400400
resWarnings.Merge(warnings)
401401
resultMtx.Unlock()
402402

@@ -407,7 +407,7 @@ func (q *blocksStoreQuerier) LabelValues(ctx context.Context, name string, match
407407
return nil, nil, err
408408
}
409409

410-
return resValueSets, resWarnings, nil
410+
return resValuesSet, resWarnings, nil
411411
}
412412

413413
func (q *blocksStoreQuerier) Close() error {

0 commit comments

Comments
 (0)