Closed rtoma closed 1 year ago
Thanks for putting this together. Just from reading your documentation, I think you're right, that it's flawed and is a bug, and does need to be fixed.
We did test it and the delete was working, so now I'm wondering if maybe the code didn't get merged. I'll take a look either way. I'll implement your change and test it locally.
Just as a FYI: At this time, we're not using this in any actual environments, so I am absolutely sure there will be edge cases we missed. We're spending most of our time at the moment operationalizing Crossplane for our organization. I'm hoping to get this into production in our space later this year. :)
Fixed by #58
What happened?
Last weeks I've been working on engineering a Kafka GitOps feature for our MSK clusters. For this I use Crossplane and this provider. To make the provider work with MSK I've contributed TLS + SCRAM authentication support.
Now managing Topics works great. Creation of ACLs works too, but deletion is not possible. To make this work I changed:
https://github.com/crossplane-contrib/provider-kafka/blob/d085e96353054c2807f37c86435130b8a5569f5c/internal/clients/kafka/acl/acl.go#L59-L68
... into:
The original code throws an error if no ACLs exist for specific criteria. My code allows this.
Now my code works flawlessly (for MSK), but since it is a significant change to the logic and it implies 'delete ACL' never worked, I wonder if I am missing something. So, I'd like a discussion before I submit a patch.
Cheers.
How can we reproduce it?
In short:
In detail:
I create the ACL. Here is the resource and its good health:
With kcl I check the Kafka side of things:
So, indeed: the ACL exists.
Now let's delete the ACL:
The delete command hangs. Meanwhile in Kafka the ACL has been removed.
Checking the to-be-deleted ACL resource from another terminal shows it's now unREADY and unSYNCED. Both as expected:
Checking the kafka provider (running in debug mode) logs I see this:
From above debug blob I'd like to highlight:
This is why I believe 'delete ACL' is flawed. The
acl.List
method throws an error when no ACLs exist. Now to me finding no matching ACLs seems like the expected result of a delete ACL action. But maybe I'm missing something?What environment did it happen in?
Crossplane version: 1.8.1 Kafka provider: 0.1.0 with TLS/SCRAM support Kubernetes: 1.22.8 (OpenShift on AWS)