grafana-operator
grafana-operator copied to clipboard
Refactor controllers to use controllerruntime CreateOrUpdate
Is your feature request related to a problem? Please describe. Currently, the operator utilises the ActionRunner Interface to perform CRUD operations on Kubernetes resources. This approach is mostly fine, however, it's not entirely future proof, nor does it lend itself to fast development, especially when considering the addition of future Loki/Promtail CR's. We should look to refactor this to a more robust solution, preferably one provided by a k8s library already.
Describe the solution you'd like Refactor the project to make use of controller-runtime/controllerutil CreateOrUpdate function. This would be a more robust solution, resources would only be updated when required (when changed) through mutateFns rather than the current approach of forcing updates, i.e the issue that was fixed by #326 , which would have been prevented with this library. Maintenance would also become easier, both for active maintainers and new users (CreateOrUpdate, amongst other functions, is standard to most operators)