@@ -35,6 +35,7 @@ import (
3535 "github.com/cortexproject/cortex/pkg/storage/bucket"
3636 "github.com/cortexproject/cortex/pkg/storage/tsdb"
3737 "github.com/cortexproject/cortex/pkg/util/backoff"
38+ cortex_errors "github.com/cortexproject/cortex/pkg/util/errors"
3839 util_log "github.com/cortexproject/cortex/pkg/util/log"
3940 "github.com/cortexproject/cortex/pkg/util/spanlogger"
4041 "github.com/cortexproject/cortex/pkg/util/validation"
@@ -232,7 +233,7 @@ func (u *BucketStores) syncUsersBlocks(ctx context.Context, f func(context.Conte
232233
233234 for job := range jobs {
234235 if err := f (ctx , job .store ); err != nil {
235- if errors .Is (err , bucket .ErrCustomerManagedKeyError ) {
236+ if errors .Is (err , bucket .ErrCustomerManagedKeyAccessDenied ) {
236237 u .storesErrorsMu .Lock ()
237238 u .storesErrors [job .userID ] = err
238239 u .storesErrorsMu .Unlock ()
@@ -304,7 +305,7 @@ func (u *BucketStores) Series(req *storepb.SeriesRequest, srv storepb.Store_Seri
304305
305306 err := u .getStoreError (userID )
306307
307- if err != nil && errors . Is (err , bucket .ErrCustomerManagedKeyError ) {
308+ if err != nil && cortex_errors . ErrorIs (err , u . bucket .IsCustomerManagedKeyError ) {
308309 return httpgrpc .Errorf (int (codes .ResourceExhausted ), "store error: %s" , err )
309310 }
310311
@@ -313,7 +314,7 @@ func (u *BucketStores) Series(req *storepb.SeriesRequest, srv storepb.Store_Seri
313314 ctx : spanCtx ,
314315 })
315316
316- if err != nil && errors . Is (err , bucket .ErrCustomerManagedKeyError ) {
317+ if err != nil && cortex_errors . ErrorIs (err , u . bucket .IsCustomerManagedKeyError ) {
317318 return httpgrpc .Errorf (int (codes .ResourceExhausted ), "store error: %s" , err )
318319 }
319320
@@ -337,13 +338,13 @@ func (u *BucketStores) LabelNames(ctx context.Context, req *storepb.LabelNamesRe
337338
338339 err := u .getStoreError (userID )
339340
340- if err != nil && errors . Is (err , bucket .ErrCustomerManagedKeyError ) {
341+ if err != nil && cortex_errors . ErrorIs (err , u . bucket .IsCustomerManagedKeyError ) {
341342 return nil , httpgrpc .Errorf (int (codes .ResourceExhausted ), "store error: %s" , err )
342343 }
343344
344345 resp , err := store .LabelNames (ctx , req )
345346
346- if err != nil && errors . Is (err , bucket .ErrCustomerManagedKeyError ) {
347+ if err != nil && cortex_errors . ErrorIs (err , u . bucket .IsCustomerManagedKeyError ) {
347348 return resp , httpgrpc .Errorf (int (codes .ResourceExhausted ), "store error: %s" , err )
348349 }
349350
@@ -367,13 +368,13 @@ func (u *BucketStores) LabelValues(ctx context.Context, req *storepb.LabelValues
367368
368369 err := u .getStoreError (userID )
369370
370- if err != nil && errors . Is (err , bucket .ErrCustomerManagedKeyError ) {
371+ if err != nil && cortex_errors . ErrorIs (err , u . bucket .IsCustomerManagedKeyError ) {
371372 return nil , httpgrpc .Errorf (int (codes .ResourceExhausted ), "store error: %s" , err )
372373 }
373374
374375 resp , err := store .LabelValues (ctx , req )
375376
376- if err != nil && errors . Is (err , bucket .ErrCustomerManagedKeyError ) {
377+ if err != nil && cortex_errors . ErrorIs (err , u . bucket .IsCustomerManagedKeyError ) {
377378 return resp , httpgrpc .Errorf (int (codes .ResourceExhausted ), "store error: %s" , err )
378379 }
379380
0 commit comments