Skip to content

nautilus: mgr/dashboard: change bucket owner between owners from same tenant#29485

Merged
LenzGr merged 1 commit intoceph:nautilusfrom
rhcs-dashboard:41067-change-bucket-owner
Nov 7, 2019
Merged

nautilus: mgr/dashboard: change bucket owner between owners from same tenant#29485
LenzGr merged 1 commit intoceph:nautilusfrom
rhcs-dashboard:41067-change-bucket-owner

Conversation

@alfonsomthd
Copy link
Contributor

@alfonsomthd alfonsomthd commented Aug 5, 2019

Since #28813 is in master, the bucket operations (with tenanted owners) behaviour has changed regarding nautilus, so this fix is applied directly.

Fixes: https://tracker.ceph.com/issues/41067
Signed-off-by: alfonsomthd almartin@redhat.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test docs
  • jenkins render docs

@tspmelo tspmelo added this to the nautilus milestone Aug 5, 2019
@tspmelo tspmelo changed the title mgr/dashboard: change bucket owner between owners from same tenant nautilus: mgr/dashboard: change bucket owner between owners from same tenant Aug 5, 2019
@tspmelo
Copy link
Contributor

tspmelo commented Aug 9, 2019

jenkins test dashboard

Copy link
Member

@votdev votdev left a comment

Choose a reason for hiding this comment

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

LGTM

raise DashboardException(e, http_status_code=500, component='rgw')

def set(self, bucket, bucket_id, uid):
bucket_tenant = bucket[:bucket.find('/')] if bucket.find('/') >= 0 else None
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add a comment here why it is necessary to strip the tenant in a special case. In some months nobody is remembering this.

Second, wouldn't it make sense to relocate the logic into strip_tenant_from_bucket_name, too? This would make the set method more cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@smithfarm smithfarm left a comment

Choose a reason for hiding this comment

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

Please update the commit message so it explains why the fix cannot be cherry-picked from master.

@alfonsomthd
Copy link
Contributor Author

Please update the commit message so it explains why the fix cannot be cherry-picked from master.

@smithfarm Done.

@smithfarm
Copy link
Contributor

smithfarm commented Aug 20, 2019

Please update the commit message so it explains why the fix cannot be cherry-picked from master.

@smithfarm Done.

Hm, maybe I'm missing something, but the commit message seems to still be the same, i.e.:

mgr/dashboard: change bucket owner between owners from same tenant

Fixes: https://tracker.ceph.com/issues/41067
Signed-off-by: alfonsomthd <almartin@redhat.com>

Having the explanation in the PR is better than nothing, but having it in the git history is best. Therefore, I was hoping the commit message could be changed so it includes this nice explanation that you added to the PR description:

Since https://github.com/ceph/ceph/pull/28813 is in master, the bucket operations
(with tenanted owners) behaviour has changed regarding nautilus, so this fix is
applied to nautilus directly.

@alfonsomthd alfonsomthd force-pushed the 41067-change-bucket-owner branch from 130f00f to 492c1b3 Compare August 20, 2019 08:44
@alfonsomthd
Copy link
Contributor Author

Hm, maybe I'm missing something, but the commit message seems to still be the same, i.e.:

@smithfarm sorry, I updated the commit message accordingly.

Copy link
Contributor

@LenzGr LenzGr left a comment

Choose a reason for hiding this comment

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

LGTM - thank you

@alfonsomthd
Copy link
Contributor Author

jenkins test dashboard

Since ceph#28813 is in master, the bucket operations
(with tenanted owners) behaviour has changed regarding nautilus, so this fix is
applied to nautilus directly.

Fixes: https://tracker.ceph.com/issues/41067
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
@alfonsomthd alfonsomthd force-pushed the 41067-change-bucket-owner branch from 492c1b3 to f267225 Compare September 17, 2019 14:04
@bk201
Copy link
Contributor

bk201 commented Sep 18, 2019

Thanks! I tested the changes on the latest Nautilus branch (462e659).
Got an error when changing bucket's owner to a user in a different tenant.

e.g.

  • Two users: foo$bar and xxx$yyy
  • Create a bucket and owned by foo$bar
  • Error when editing the bucket and change the owner to xxx$yyy

Also, I saw different behaviors between master and nautilus. When changing the owner for a bucket, the tenant prefix will be changed accordingly in master but not in nautilus. Is this a bug?

@smithfarm smithfarm removed their request for review September 18, 2019 08:38
@smithfarm smithfarm dismissed their stale review September 18, 2019 08:38

commit message looks good now

@alfonsomthd
Copy link
Contributor Author

alfonsomthd commented Sep 18, 2019

Thanks! I tested the changes on the latest Nautilus branch (462e659).

Got an error when changing bucket's owner to a user in a different tenant.

e.g.

* Two users: foo$bar and xxx$yyy

* Create a bucket and owned by `foo$bar`

* Error when editing the bucket and change the owner to `xxx$yyy`

Also, I saw different behaviors between master and nautilus. When changing the owner for a bucket, the tenant prefix will be changed accordingly in master but not in nautilus. Is this a bug?

The error is expected as currently it is not possible to access another tenant’s buckets:
https://docs.ceph.com/docs/nautilus/radosgw/multitenancy/#accessing-buckets-with-explicit-tenants

Thus a complete compatibility is maintained with previous releases, as long as the referred
buckets and referring user belong to the same tenant. In other words, anything unusual occurs
when accessing another tenant’s buckets only.

The behavior in master has evolved regarding nautilus.

@alfonsomthd
Copy link
Contributor Author

jenkins test dashboard backend

@LenzGr LenzGr added the nautilus-batch-1 nautilus point releases label Sep 25, 2019
@alfonsomthd
Copy link
Contributor Author

jenkins test dashboard backend

@bk201
Copy link
Contributor

bk201 commented Sep 26, 2019

LGTM. Also run qa test mgr.dashboard.test_rgw.RgwBucketTest locally.

@smithfarm
Copy link
Contributor

smithfarm commented Oct 1, 2019

@LenzGr I see you added the nautilus-batch-1 label. Does that mean we can disregard the failed ceph dashboard backend API tests Jenkins PR CI test?

(Ordinarily, nautilus-batch-1 is not added until all relevant Jenkins PR tests are passing.)

@alfonsomthd
Copy link
Contributor Author

alfonsomthd commented Oct 2, 2019

@LenzGr I see you added the nautilus-batch-1 label. Does that mean we can disregard the failed ceph dashboard backend API tests Jenkins PR CI test?

(Ordinarily, nautilus-batch-1 is not added until all relevant Jenkins PR tests are passing.)

@smithfarm @LenzGr The failure is not related to this PR.
As @bk201 commented before, the related API tests pass locally.

jenkins test dashboard backend is a job that has been tested in master branch (it works) but never in nautilus branch,
I triggered it because "it should work" for nautilus branch, but this subject should be investigated in more detail. There is an issue: https://tracker.ceph.com/issues/40035

@smithfarm
Copy link
Contributor

@alfonsomthd Thanks for the explanation!

@callithea
Copy link
Member

callithea commented Oct 28, 2019

@LenzGr LenzGr changed the title nautilus: mgr/dashboard: change bucket owner between owners from same tenant nautilus: mgr/dashboard: change bucket owner between owners fr… Nov 7, 2019
@LenzGr LenzGr merged commit 16d86fd into ceph:nautilus Nov 7, 2019
@smithfarm smithfarm changed the title nautilus: mgr/dashboard: change bucket owner between owners fr… nautilus: mgr/dashboard: change bucket owner between owners from same tenant Nov 8, 2019
@alfonsomthd alfonsomthd deleted the 41067-change-bucket-owner branch April 9, 2020 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants