feat(kafka acl): add acl delete command#1218
feat(kafka acl): add acl delete command#1218craicoverflow merged 6 commits intoredhat-developer:mainfrom
acl delete command#1218Conversation
8840632 to
ef9274d
Compare
82343aa to
e5ec951
Compare
acl delete command
e5ec951 to
f727cb8
Compare
|
This ended up quite large, lots of boilerplate involved. I will continue testing it tomorrow. But ready for review. |
preview: |
2a8df77 to
ab05437
Compare
ab05437 to
1bce892
Compare
Is this a question? |
Message got lost. On trying to delete a ACL for transactional id, topic is being accessed. Command: |
|
Thanks for catching that, it is fixed now. |
|
Command: |
|
Command: |
|
Command: |
pkg/kafka/aclutil/constants.go
Outdated
| OperationFilterDELETE = "delete" | ||
| OperationFilterALTER = "alter" | ||
| OperationFilterDESCRIBE = "describe" | ||
| OperationFilterDESCRIBE_CONFIGS = "describe-config" |
There was a problem hiding this comment.
Should we use plural like alter-configs?
| OperationFilterDESCRIBE_CONFIGS = "describe-config" | |
| OperationFilterDESCRIBE_CONFIGS = "describe-configs" |
pkg/cmd/kafka/acl/flags/flags.go
Outdated
| return withMarkRequiredFunc(fs.cmd, flagName) | ||
| } | ||
|
|
||
| // AddUser adds a flag to pass a user ID principal |
There was a problem hiding this comment.
| // AddUser adds a flag to pass a user ID principal | |
| // AddServiceAccount adds a flag to pass a service account ID principal |
|
A rare scenario: If user creates a ACL rule using CLI with pricipal="all", <Allow | Read> and topic starts with "all". It would be impossible to delete using CLI, is that an edge case we should handle? |
3411054 to
09758ac
Compare
09758ac to
3e66214
Compare
ff3d1ba to
270b53f
Compare
As agreed, I have now removed wildcard aliases. Could you review again? |
|
Seems like an issue with api maybe |
Playing around the api a little, I found out that list operation lists out all the permissions with those specifics for the given user, including the ones it gets from Similarly, searching for a rule that isn't defined for the user but defined for "All accounts" is returned. I think list operation is working as it should be, some changes should be made to delete to prevent deleting the all account rules. Wdyt? |
|
Can you move this to a new issue where can we can discuss this? It will be lost/hidden here. |
This PR adds a command to delete ACLs which match criteria passed via filters.
Example interaction:
I also refactored some of the ACL util files into one package.
Verification
This allows numerous operation combinations so will require extensive verification and testing. Run
rhoas kafka acl deleteand try a number of combinations.