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
125 stars 42 forks source link

Update resource's status only on change #286

Closed juldrixx closed 1 year ago

juldrixx commented 1 year ago
Q A
Bug fix? no
New feature? yes
API breaks? no
Deprecations? no
Related tickets -
License Apache 2.0

What's in this PR?

Update controllers to update resource status only if a modification has been made.

Why?

In GKE, even if no changes have been made to the state, the update call always generates logs. So the more resources you have, the more logs you have, and since in GCP these logs are invoiced, the bill becomes high. And also to reduce the load on K8S.

Checklist

mh013370 commented 1 year ago

This seems okay to me. I verified that in each controller, the status is fetched immediately and that's what is used for comparison. LGTM