Skip to content

Commit ccb0482

Browse files
committed
lint
Signed-off-by: Alan Protasio <[email protected]>
1 parent 530d987 commit ccb0482

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pkg/compactor/compactor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,8 @@ func (c *Compactor) starting(ctx context.Context) error {
582582
func (c *Compactor) stopping(_ error) error {
583583
ctx := context.Background()
584584

585-
services.StopAndAwaitTerminated(ctx, c.blocksCleaner) //nolint:errcheck
586-
services.StopAndAwaitTerminated(context.Background(), c.allowedTenants) //nolint:errcheck
585+
services.StopAndAwaitTerminated(ctx, c.blocksCleaner) //nolint:errcheck
586+
services.StopAndAwaitTerminated(ctx, c.allowedTenants) //nolint:errcheck
587587
if c.ringSubservices != nil {
588588
return services.StopManagerAndAwaitStopped(ctx, c.ringSubservices)
589589
}

pkg/ruler/ruler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func (r *Ruler) starting(ctx context.Context) error {
340340
if r.cfg.EnableSharding {
341341
var err error
342342

343-
if r.subservices, err = services.NewManager(r.lifecycler, r.ring, r.clientsPool, r.allowedTenants); err != nil {
343+
if r.subservices, err = services.NewManager(r.lifecycler, r.ring, r.clientsPool); err != nil {
344344
return errors.Wrap(err, "unable to start ruler subservices")
345345
}
346346

@@ -366,7 +366,7 @@ func (r *Ruler) stopping(_ error) error {
366366
}
367367

368368
services.StopAndAwaitTerminated(context.Background(), r.allowedTenants) //nolint:errcheck
369-
369+
370370
return nil
371371
}
372372

pkg/util/allowed_tenants.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ type AllowedTenants struct {
3434
// If there are any enabled tenants, then only those tenants are allowed.
3535
// If there are any disabled tenants, then tenant from that list, that would normally be allowed, is disabled instead.
3636
func NewAllowedTenants(cfg AllowedTenantConfig, allowedTenantConfigFn func() *AllowedTenantConfig) *AllowedTenants {
37+
if allowedTenantConfigFn == nil {
38+
allowedTenantConfigFn = func() *AllowedTenantConfig { return &cfg }
39+
}
40+
3741
a := &AllowedTenants{
3842
allowedTenantConfigFn: allowedTenantConfigFn,
3943
defaultCfg: &cfg,
4044
}
4145

42-
if allowedTenantConfigFn == nil {
43-
allowedTenantConfigFn = func() *AllowedTenantConfig { return a.defaultCfg }
44-
}
45-
4646
a.setConfig(allowedTenantConfigFn())
4747

4848
a.Service = services.NewBasicService(nil, a.running, nil)

0 commit comments

Comments
 (0)