Rework CR deletion / finalizers
The following discussion from !7 (merged) should be addressed:
-
@feleouet started a discussion: (+1 comment) I don't see any place where this finalizer is added to SylvaUnitsRelease, main reconcile loop should probalby ensure that it is added to the resource.
@tmmorin :
I kept the pattern from the original code initially contributed to workload-cluster operator, which I have also realized was incomplete.
I plan to revisit all delete/finalizer code separately.
As we'll have to manage a large variety of rersources, it would probably be cleaner to check if
suReleaseis being deleted in main reconcile function, and call a reconcileDelete from there that will handle the cleanup of various owned/created resources. This pattern is widely used in many controllers, we should probably try to follow this best practice.