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
mon: improvements and cleanup for AuthMonitor #52008
Conversation
jenkins retest this please |
9eb0779
to
b1e1475
Compare
b1e1475
to
27d04e7
Compare
19ee380
to
2b07176
Compare
2b07176
to
66448c3
Compare
66448c3
to
6ca325b
Compare
6ca325b
to
2eac33a
Compare
Instead of repeating same lines of code to encode entity's auth keyring (or just key) before printing, add a method for this and use it instead. This commit is nothing more than refactoring to avoid duplication and improve readability; it shouldn't make any functional changes. Signed-off-by: Rishabh Dave <ridave@redhat.com>
8ede7c1
to
800c9d2
Compare
800c9d2
to
63e5a38
Compare
Although the variable "caps_vec" is defined as a vector (with following as its members: {"mon", <moncap>, "osd", <osdcap>, "mgr", <mgrcap>, "mds", <mdscap>}) it actually is used and iterated as a map. Simplify the code by using a map instead of vector for storing caps. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Instead of rewriting, code to check if caps are valid & to encode caps, let's create a new helper method and use it instead. Also, the name "new_caps" is used to store encoded caps. Let's rename such variables to "encoded_caps". Signed-off-by: Rishabh Dave <ridave@redhat.com>
63e5a38
to
3d19749
Compare
Made few minor changes to some of the commit messages. |
Move the code for "ceph auth caps" command to a separate function so that the code can be reused to update caps. Most of the code here is same as the code for creating new entity, so let's modify this method to also create an entity. Also, create helper methods to update and create an entity. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Since PR ceph#50874 has been merged, this method can do the exact same job in much lesser code. Also since we are here, let's rename variable "type" to "entity". Signed-off-by: Rishabh Dave <ridave@redhat.com>
3d19749
to
8627af3
Compare
Minor change in commit message. |
@ljflores Please pick this PR for testing with RADOS suite. |
jenkins test make check arm64 |
I've talked with Radoslaw and Laura. I am getting started with testing on my own. |
Any reason @yuriw will not run this with main branch tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RADOS testing went fine - https://tracker.ceph.com/projects/rados/wiki/MAIN#2023-Jun-23.
Got it double checked with Laura. Thanks to @ljflores.
@vshankar Yuri could have picked it up but @rishabh-d-dave wanted to test it himself. |
Any other subsystem runs required for this change? |
I've tested this PR with CephFS testsuite as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CephFS testsuite ran fine with against this PR. For results see - https://tracker.ceph.com/projects/cephfs/wiki/Main#27-Jun-2023
no need to run rgw |
@rzarzynski Many thanks for so many and so quick review! |
The commits originally were part of #41779.
This PR contains creates and uses helper functions to not only reduce code duplication but also improve readability. Helper functions have been added for encoding keyrings (fully as well as partially), updating caps for an entity, creating new entity and checking and encoding caps. Besides, it also replace vectors by maps for storing caps.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows