Repository navigation
mgr/dashboard: keep tenant when editing a bucket without changing owner - #73065
Open
rishitrawat2006 wants to merge 1 commit into
Open
rishitrawat2006 wants to merge 1 commit into
rishitrawat2006 wants to merge 1 commit into
Conversation
When a bucket is edited (e.g. its replication is changed) the owner is
not being changed, so the request carries an empty uid. RgwBucket.set()
derived the tenant from the uid only. The tenant was therefore dropped
from the bucket name ('kenny/test-bucket' became 'test-bucket') and RGW
was queried as the dashboard's own user, which lives in the default
tenant. RGW answered NoSuchBucket, which surfaced as an HTTP 500 from
get_bucket_locking().
When no uid is given, look up the bucket and take the tenant and owner
from it, the same way RgwBucket.get() does. Add a unit test.
Fixes: https://tracker.ceph.com/issues/81765
Signed-off-by: Rishit Rawat <rawatrishit2029@gmail.com>
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
Author
|
@AnuragRaut08 could u pls review it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a bucket is edited (e.g. its replication is changed) the owner is not being changed, so the request carries an empty uid. RgwBucket.set() derived the tenant from the uid only. The tenant was therefore dropped from the bucket name ('kenny/test-bucket' became 'test-bucket') and RGW was queried as the dashboard's own user, which lives in the default tenant. RGW answered NoSuchBucket, which surfaced as an HTTP 500 from get_bucket_locking().
When no uid is given, look up the bucket and take the tenant and owner from it, the same way RgwBucket.get() does. Add a unit test.
Fixes: https://tracker.ceph.com/issues/81765
I tested this with a unit test using mocks, and the test fails without the change. I have not tested it against a real multi-tenant RGW cluster, so a review of that part would be appreciated. In the empty-uid case the change adds one extra RGW request.
Checklist