Skip to content

Commit 19992e0

Browse files
committed
fix lint
Signed-off-by: Daniel Deluiggi <[email protected]>
1 parent 3ff1a68 commit 19992e0

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
@@ -761,7 +761,7 @@ func (c *BlocksCleaner) cleanUser(ctx context.Context, userLogger log.Logger, us
761761
}
762762

763763
func (c *BlocksCleaner) cleanPartitionedGroupInfo(ctx context.Context, userBucket objstore.InstrumentedBucket, userLogger log.Logger, userID string) {
764-
err, existentPartitionedGroupInfo := c.iterPartitionGroups(ctx, userBucket, userLogger)
764+
existentPartitionedGroupInfo, err := c.iterPartitionGroups(ctx, userBucket, userLogger)
765765
if err != nil {
766766
level.Warn(userLogger).Log("msg", "error return when going through partitioned group directory", "err", err)
767767
}
@@ -800,7 +800,7 @@ func (c *BlocksCleaner) cleanPartitionedGroupInfo(ctx context.Context, userBucke
800800
}
801801

802802
func (c *BlocksCleaner) emitUserMetrics(ctx context.Context, userLogger log.Logger, userBucket objstore.InstrumentedBucket, userID string) {
803-
err, existentPartitionedGroupInfo := c.iterPartitionGroups(ctx, userBucket, userLogger)
803+
existentPartitionedGroupInfo, err := c.iterPartitionGroups(ctx, userBucket, userLogger)
804804
if err != nil {
805805
level.Warn(userLogger).Log("msg", "error return when going through partitioned group directory", "err", err)
806806
}
@@ -829,10 +829,10 @@ func (c *BlocksCleaner) emitUserMetrics(ctx context.Context, userLogger log.Logg
829829
}
830830
}
831831

832-
func (c *BlocksCleaner) iterPartitionGroups(ctx context.Context, userBucket objstore.InstrumentedBucket, userLogger log.Logger) (error, map[*PartitionedGroupInfo]struct {
832+
func (c *BlocksCleaner) iterPartitionGroups(ctx context.Context, userBucket objstore.InstrumentedBucket, userLogger log.Logger) (map[*PartitionedGroupInfo]struct {
833833
path string
834834
status PartitionedGroupStatus
835-
}) {
835+
}, error) {
836836
existentPartitionedGroupInfo := make(map[*PartitionedGroupInfo]struct {
837837
path string
838838
status PartitionedGroupStatus
@@ -858,7 +858,7 @@ func (c *BlocksCleaner) iterPartitionGroups(ctx context.Context, userBucket objs
858858
}
859859
return nil
860860
})
861-
return err, existentPartitionedGroupInfo
861+
return existentPartitionedGroupInfo, err
862862
}
863863

864864
// 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 {
@@ -1142,7 +1141,7 @@ func TestBlocksCleaner_EmitUserMetrics(t *testing.T) {
11421141
cortex_compactor_remaining_planned_compactions{user="user-1"} 3
11431142
`
11441143

1145-
assert.NoError(t, testutil.GatherAndCompare(registry, strings.NewReader(expectedMetrics), metricNames...))
1144+
assert.NoError(t, prom_testutil.GatherAndCompare(registry, strings.NewReader(expectedMetrics), metricNames...))
11461145
}
11471146

11481147
type mockConfigProvider struct {

0 commit comments

Comments
 (0)