konpyutaika / nifikop

The NiFiKop NiFi Kubernetes operator makes it easy to run Apache NiFi on Kubernetes. Apache NiFI is a free, open-source solution that support powerful and scalable directed graphs of data routing, transformation, and system mediation logic.
https://konpyutaika.github.io/nifikop/
Apache License 2.0
126 stars 44 forks source link

fix issue where certs get re-created immediately after deletion #210

Closed mh013370 closed 1 year ago

mh013370 commented 1 year ago
Q A
Bug fix? yes
New feature? no
API breaks? no
Deprecations? no
Related tickets fixes #209
License Apache 2.0

What's in this PR?

The nifi user controller hits a condition where a NifiUser is marked for deletion and the controller revokes certs and deletes secrets. However, it then immediately reconciles the certs & secrets again which re-creates them. The code which does this is here. This causes NifiCluster deletions in ArgoCD to hang and not delete cleanly because the operator is re-creating resources that had just been deleted.

I tested this by deploying a NifiCluster via ArgoCD. Once it came all the way up & certs had been generated, I deleted the cluster in ArgoCD. Prior to this change, the deletion would get hung up on Certificates/Secrets that the operator re-created. With this change, clusters are gracefully deleted by ArgoCD and re-created.

Why?

To correctly reconcile resources associated with NifiUser objects.

Checklist