Skip to content

Commit 3505c59

Browse files
committed
fix lint
Signed-off-by: Daniel Deluiggi <[email protected]>
1 parent 2c8293b commit 3505c59

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pkg/compactor/blocks_cleaner.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ func (c *BlocksCleaner) updateBucketMetrics(userID string, parquetEnabled bool,
781781
}
782782

783783
func (c *BlocksCleaner) cleanPartitionedGroupInfo(ctx context.Context, userBucket objstore.InstrumentedBucket, userLogger log.Logger, userID string) {
784-
err, existentPartitionedGroupInfo := c.iterPartitionGroups(ctx, userBucket, userLogger)
784+
existentPartitionedGroupInfo, err := c.iterPartitionGroups(ctx, userBucket, userLogger)
785785
if err != nil {
786786
level.Warn(userLogger).Log("msg", "error return when going through partitioned group directory", "err", err)
787787
}
@@ -820,7 +820,7 @@ func (c *BlocksCleaner) cleanPartitionedGroupInfo(ctx context.Context, userBucke
820820
}
821821

822822
func (c *BlocksCleaner) emitUserMetrics(ctx context.Context, userLogger log.Logger, userBucket objstore.InstrumentedBucket, userID string) {
823-
err, existentPartitionedGroupInfo := c.iterPartitionGroups(ctx, userBucket, userLogger)
823+
existentPartitionedGroupInfo, err := c.iterPartitionGroups(ctx, userBucket, userLogger)
824824
if err != nil {
825825
level.Warn(userLogger).Log("msg", "error return when going through partitioned group directory", "err", err)
826826
}
@@ -849,10 +849,10 @@ func (c *BlocksCleaner) emitUserMetrics(ctx context.Context, userLogger log.Logg
849849
}
850850
}
851851

852-
func (c *BlocksCleaner) iterPartitionGroups(ctx context.Context, userBucket objstore.InstrumentedBucket, userLogger log.Logger) (error, map[*PartitionedGroupInfo]struct {
852+
func (c *BlocksCleaner) iterPartitionGroups(ctx context.Context, userBucket objstore.InstrumentedBucket, userLogger log.Logger) (map[*PartitionedGroupInfo]struct {
853853
path string
854854
status PartitionedGroupStatus
855-
}) {
855+
}, error) {
856856
existentPartitionedGroupInfo := make(map[*PartitionedGroupInfo]struct {
857857
path string
858858
status PartitionedGroupStatus
@@ -878,7 +878,7 @@ func (c *BlocksCleaner) iterPartitionGroups(ctx context.Context, userBucket objs
878878
}
879879
return nil
880880
})
881-
return err, existentPartitionedGroupInfo
881+
return existentPartitionedGroupInfo, err
882882
}
883883

884884
// cleanUserPartialBlocks delete partial blocks which are safe to be deleted. The provided partials map

pkg/compactor/blocks_cleaner_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"github.com/cortexproject/cortex/pkg/util"
2929
util_log "github.com/cortexproject/cortex/pkg/util/log"
3030
"github.com/cortexproject/cortex/pkg/util/services"
31-
"github.com/prometheus/client_golang/prometheus/testutil"
3231
)
3332

3433
type testBlocksCleanerOptions struct {
@@ -1248,7 +1247,7 @@ func TestBlocksCleaner_EmitUserMetrics(t *testing.T) {
12481247
cortex_compactor_remaining_planned_compactions{user="user-1"} 3
12491248
`
12501249

1251-
assert.NoError(t, testutil.GatherAndCompare(registry, strings.NewReader(expectedMetrics), metricNames...))
1250+
assert.NoError(t, prom_testutil.GatherAndCompare(registry, strings.NewReader(expectedMetrics), metricNames...))
12521251
}
12531252

12541253
type mockConfigProvider struct {

0 commit comments

Comments
 (0)