ozone
ozone copied to clipboard
HDDS-7347. [Multi-Tenant] Add proper error message to TenantAssignAdmin and TenantRevokeAdmin
What changes were proposed in this pull request?
- Add error message when the same user is assigned as tenant admin.
- Add error message when the non-admin user is revoked as tenant admin.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7347
How was this patch tested?
The patch was tested using unit tests.
Why can't these APIs be idempotent? if the user is already admin, it should pass, and if the user is not admin, it revoke should pass as well. Why raise an exception?
The goal is to propagate back clear messages for these scenarios to improve user experience.
The goal is to propagate back clear messages for these scenarios to improve user experience.
I would still push back against this change. Usually, set ownership or admin access APIs/CLIs are idempotent. The only variation I can imagine is printing that the user was already admin or had access revoked, but the exit/return code/status should be successful.
Thanks @aswinshakil for the effort. Closing this PR without merging it after our discussion with @kerneltime .