SystemCraftsman / strimzi-kafka-cli

Command Line Interface for the Strimzi Kafka Operator
Apache License 2.0
78 stars 13 forks source link

Unable to add ACLs using kfk acls --add but with kfk users --alter --add-acl #87

Closed arpan57 closed 2 years ago

arpan57 commented 3 years ago

Hi,

I am trying to add an ACL like following

kfk acls --add --allow-principal User:secure-writer --operation Write --topic secure-topic -c my-cluster -n secure-ns Hitting return key I get a message kafkauser.kafka.strimzi.io/secure-writer configured.

But when I describe the user usingkfk users --describe --user secure-writer -n secure-ns -c my-cluster I don't see anything for Authorization added in the Spec portion of the User.

Similarly if I list the acls using kfk acls --list -n secure-ns -c my-cluster I don't see any entry for the secure-topic or for secure-writer.

Now I am trying to add ACLs using the kfk users

kfk users --user secure-writer --alter --authorization-type simple --add-acl --operation Write --resource-type topic --resource-name secure-topic -c my-cluster -n secure-ns

This works. I can see the ACLs got updated for the user. I can see it updated under kfk user --describe as well as in kfk acls --list also.

Am I missing any parameters while creating the ACLs using kfk acls? or it's a bug?

Versions Strimzi CLI 0.1.0a57 Strimzi 0.20.1 Kubectl v1.16.15

Regards, Arpan

mabulgu commented 2 years ago

I think this is because we dont set authorization type while running kfk acls --add --allow-principal User:secure-writer --operation Write --topic secure-topic -c my-cluster -n secure-ns.

That should do it automatically. The following is an already open issue for this: https://github.com/systemcraftsman/strimzi-kafka-cli/issues/33

Will be fixed in the next release!

mabulgu commented 2 years ago

Closing this one as well since I will fix this in #33.

mabulgu commented 2 years ago

Fix is released with the new version: https://github.com/systemcraftsman/strimzi-kafka-cli/releases/tag/0.1.0-alpha58

Run the following to upgrade your Strimzi CLI version:

sudo pip install strimzi-kafka-cli --upgrade