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

mgr/dashboard: Add RGW user and bucket lists (read-only) #20869

Merged
merged 3 commits into from Apr 20, 2018

Conversation

Projects
None yet
5 participants
@votdev
Copy link
Contributor

votdev commented Mar 13, 2018

Add read-only support to display RGW user and bucket information.
fireshot capture 13 - ceph - http___localhost_4200_ _rgw_buckets

fireshot capture 12 - ceph - http___localhost_4200_ _rgw_users

Signed-off-by: Volker Theile vtheile@suse.com

@votdev votdev requested review from LenzGr , tspmelo , ricardoasmarques and Devp00l Mar 13, 2018

@votdev votdev changed the title [WIP,DNM] mgr/dashboard v2: Add RGW user and bucket lists (read-only) [DNM] mgr/dashboard v2: Add RGW user and bucket lists (read-only) Mar 13, 2018

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch from f1e7dca to 9f2d19f Mar 16, 2018

@LenzGr LenzGr changed the title [DNM] mgr/dashboard v2: Add RGW user and bucket lists (read-only) [DNM] mgr/dashboard: Add RGW user and bucket lists (read-only) Mar 16, 2018

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch 5 times, most recently from 8e2765c to 82d6ba5 Mar 16, 2018

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch 4 times, most recently from b5d4ff8 to 9dd9b63 Mar 26, 2018

@votdev votdev added the dashboard label Apr 3, 2018

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch 3 times, most recently from 8cc6fd0 to a57d1f6 Apr 3, 2018

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch 3 times, most recently from 6e9163a to 08fefd8 Apr 9, 2018

@votdev

This comment has been minimized.

Copy link
Contributor Author

votdev commented Apr 16, 2018

jenkins retest this please

1 similar comment
@rjfd

This comment has been minimized.

Copy link
Contributor

rjfd commented Apr 17, 2018

jenkins retest this please

@ricardoasmarques

This comment has been minimized.

Copy link
Member

ricardoasmarques commented Apr 17, 2018

If I try to access Object Gateway > Users, without having RGW configured I lost my authentication and I'm redirected to the login page. Is this behavior intentional?

screenshot from 2018-04-17 10-33-01

@@ -77,7 +77,7 @@ dashboard, you will need to provide credentials. If you do not have a user
which shall be used for providing those credentials, you will also need to
create one::

$ radosgw-admin user create --uuid=<user> --display-name=<display-name> \

This comment has been minimized.

@LenzGr

LenzGr Apr 17, 2018

Contributor

Consider removing that patch, as I already corrected that typo and moved this paragraph from the README to the reference manual in #21443

This comment has been minimized.

@votdev

votdev Apr 18, 2018

Author Contributor

Done

@LenzGr

This comment has been minimized.

Copy link
Contributor

LenzGr commented Apr 17, 2018

@ricardoasmarques this is indeed a gotcha I already raised on IRC (IIRC). @votdev is there a way for the Proxy or Frontend to "capture" that 401 Error from RGW and treat it differently than logging me out of the UI?

@rjfd

This comment has been minimized.

Copy link
Contributor

rjfd commented Apr 17, 2018

jenkins retest this please

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch from 7ab3cc4 to 8c974de Apr 18, 2018

@votdev

This comment has been minimized.

Copy link
Contributor Author

votdev commented Apr 18, 2018

@ricardoasmarques @LenzGr The user is redirected to the login page in case of invalid RGW Admin OPS credentials because the previous RGW controller implementation redirects proxy errors (in this case a 401) directly to the UI which is incorrect. This has been fixed now.

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch from 8c974de to 7f4255e Apr 18, 2018

@LenzGr

This comment has been minimized.

Copy link
Contributor

LenzGr commented Apr 18, 2018

retest this please

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch from 7f4255e to 04e41a8 Apr 18, 2018

@@ -44,7 +44,7 @@ def setUpClass(cls):
def test_no_credentials_exception(self):
resp = self._get('/api/rgw/proxy/status')
self.assertStatus(401)

This comment has been minimized.

@rjfd

rjfd Apr 18, 2018

Contributor

the return status is now 500

This comment has been minimized.

@votdev

votdev Apr 18, 2018

Author Contributor

Done

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch from 04e41a8 to a26cb4e Apr 18, 2018

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch from a26cb4e to 1ed9777 Apr 18, 2018

@rjfd

This comment has been minimized.

Copy link
Contributor

rjfd commented Apr 18, 2018

QA tests failed: http://pulpito.ceph.com/rdias-2018-04-18_15:02:35-rados:mgr-wip-rdias-testing-distro-basic-smithi/

2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:======================================================================
2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:ERROR: test_rgw_proxy (tasks.mgr.dashboard.test_rgw.RgwProxyTest)
2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_ceph-c_wip-rdias-testing/qa/tasks/mgr/dashboard/helper.py", line 25, in decorate
2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:    return func(self, *args, **kwargs)
2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_ceph-c_wip-rdias-testing/qa/tasks/mgr/dashboard/test_rgw.py", line 140, in test_rgw_proxy
2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:    self._test_delete()
2018-04-18T15:25:37.515 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_ceph-c_wip-rdias-testing/qa/tasks/mgr/dashboard/test_rgw.py", line 119, in _test_delete
2018-04-18T15:25:37.516 INFO:tasks.cephfs_test_runner:    self.assertIn('detail', resp)
2018-04-18T15:25:37.516 INFO:tasks.cephfs_test_runner:  File "/usr/lib/python2.7/unittest/case.py", line 800, in assertIn
2018-04-18T15:25:37.516 INFO:tasks.cephfs_test_runner:    if member not in container:
2018-04-18T15:25:37.516 INFO:tasks.cephfs_test_runner:TypeError: argument of type 'NoneType' is not iterable
2018-04-18T15:25:37.516 INFO:tasks.cephfs_test_runner:
2018-04-18T15:25:37.516 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------

ceph-mgr log:

2018-04-18 15:25:36.469 7fb0916b9700 20 mgr[dashboard] [::ffff:172.21.0.51:43666] [DELETE] [admin] /api/rgw/proxy/user
2018-04-18 15:25:36.469 7fb0916b9700 20 mgr[dashboard] proxying method=DELETE path=user params={'uid': u'teuth-test-user'} data=None
2018-04-18 15:25:36.469 7fb0916b9700 20 mgr[dashboard] RGW REST API DELETE req: /admin/user data: None
2018-04-18 15:25:36.509 7fb0916b9700  0 mgr[dashboard] RGW REST API failed DELETE req status: 404
2018-04-18 15:25:36.509 7fb0916b9700 20 mgr[dashboard] expire at browser close: True
2018-04-18 15:25:36.509 7fb0916b9700 20 mgr[dashboard] expire at browser close: removing 'expires' and 'max-age'
2018-04-18 15:25:36.509 7fb0916b9700  4 mgr[dashboard] [::ffff:172.21.0.51:43666] [DELETE] [500] [0.042s] [admin] [193B] /api/rgw/proxy/user
self.assertIn('HostId', resp)
self.assertIn('RequestId', resp)
self.assertEqual(resp['Code'], 'NoSuchUser')
resp = self._delete('/api/rgw/proxy/user', params={'uid': 'teuth-test-user'})

This comment has been minimized.

@rjfd

rjfd Apr 18, 2018

Contributor

self._delete does not return anything. Please add a line below with: resp = self._resp.json() as it was before this chage, or change the _delete method in helper.py to return the value.

This comment has been minimized.

@votdev

votdev Apr 19, 2018

Author Contributor

Sorry, you're right, self._delete does not return anything, but self._request. Seems i did not realize the missing of the small word return :-)

votdev added some commits Mar 6, 2018

mgr/dashboard: Add RGW user and bucket lists (read-only)
Signed-off-by: Volker Theile <vtheile@suse.com>
mgr/dashboard: Force datatable to hide the loading indicator in case …
…of an error.

Signed-off-by: Volker Theile <vtheile@suse.com>
mgr/dashboard: Modify RGW proxy response of errors to display a detai…
…led message in the error notification.

Signed-off-by: Volker Theile <vtheile@suse.com>

@votdev votdev force-pushed the votdev:dashboard_rgw_ro branch from 1ed9777 to ee5c9ad Apr 19, 2018

@rjfd

This comment has been minimized.

Copy link
Contributor

rjfd commented Apr 20, 2018

QA dashboard test cases run successfully although the tests were marked as failed due to an unrelated failure: http://pulpito.ceph.com/rdias-2018-04-19_15:33:17-rados:mgr-wip-rdias-testing-distro-basic-smithi/

@rjfd

rjfd approved these changes Apr 20, 2018

the comments were addressed

@LenzGr LenzGr merged commit 6d07530 into ceph:master Apr 20, 2018

4 of 5 checks passed

make check (arm64) make check failed
Details
Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details

@votdev votdev deleted the votdev:dashboard_rgw_ro branch Apr 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment