Update managed resources when GitLab CR Spec changes
Summary
Currently, the Operator can only create a new set of managed resources and does not update them (or at least all of them) when the CR spec changes.
We'll need to support checking if the desired spec matches the existing state of the managed resources. If not, the controller must update them accordingly.
Acceptance criteria
A CR can be modified and sent up to the cluster, and the Controller must detect the change and update the related objects accordingly.
References
-
The nginx-ingress-operator provides a helpful reference for implementing the concept of checking if an object has changed.
-
When implemented, this function can be called to check if the spec has changed, and if so, it will update the resource.
-
Here is another example from the Runner operator.
-
We may be able to use CreateOrUpdate from the controller-runtime package.
-
Some inspiration for predicates from the deprecated operator may be helpful.