Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing return code from storegateway for CMK errors #5442

Merged

Conversation

alanprot
Copy link
Member

@alanprot alanprot commented Jul 5, 2023

What this PR does:
This is a follow up of #5420 and basically change the return code from ResourceExhausted to PermissionDenied.

Also adding the changelog that was forgotten on the last PR.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • [NA] Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@alanprot alanprot force-pushed the kms-handling-access-denied-storegateway branch from 9bc4569 to a878b61 Compare July 5, 2023 23:42
…nDenied

Signed-off-by: Alan Protasio <alanprot@gmail.com>
@alanprot alanprot force-pushed the kms-handling-access-denied-storegateway branch from a878b61 to 3854099 Compare July 6, 2023 00:15
Signed-off-by: Alan Protasio <alanprot@gmail.com>
@alanprot alanprot force-pushed the kms-handling-access-denied-storegateway branch from 28485bb to c7f7ef1 Compare July 6, 2023 00:25
Signed-off-by: Alan Protasio <alanprot@gmail.com>
@alanprot alanprot force-pushed the kms-handling-access-denied-storegateway branch from c7f7ef1 to 4833995 Compare July 6, 2023 00:27
@alanprot alanprot changed the title Changing error return code from storegateway for CMK errors Changing return code from storegateway for CMK errors Jul 6, 2023
@alanprot alanprot marked this pull request as ready for review July 6, 2023 00:31
@alanprot alanprot force-pushed the kms-handling-access-denied-storegateway branch from feaa2cf to 25be4da Compare July 6, 2023 01:15
Signed-off-by: Alan Protasio <alanprot@gmail.com>
@alanprot alanprot force-pushed the kms-handling-access-denied-storegateway branch from 25be4da to f1107b2 Compare July 6, 2023 05:24
@@ -299,25 +299,22 @@ func (u *BucketStores) Series(req *storepb.SeriesRequest, srv storepb.Store_Seri
}

store := u.getStore(userID)
userBkt := bucket.NewUserBucketClient(userID, u.bucket, u.limits)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are initializing a new bkt client every Series request? Can we just use u.bucket here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to do this to unwrap the error, but creating this here is just creating an object (it does not do anything).

pkg/storegateway/bucket_stores_test.go Outdated Show resolved Hide resolved
Signed-off-by: Alan Protasio <alanprot@gmail.com>
@yeya24 yeya24 merged commit 7b51a48 into cortexproject:master Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants