During the update phase implementation the controller.Upsert() function popped out as non functioning when updating resources.
Additional Context
The function works perfectly fine when new objects are being added though it does not work for update. This is due to the fact that the underlying implementation uses CachedReader object which overwrites any updated resources unless a mutating function is passed to CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object, f MutateFn) (OperationResult, error).
Logs
No response
Expected Behavior
Either:
controller.Upsert() should be refactored to allow update as well
remove controller.Upsert() and use directly the underlying function controllerutil.CreateOrUpdate()
Description
During the update phase implementation the controller.Upsert() function popped out as non functioning when updating resources.
Additional Context
The function works perfectly fine when new objects are being added though it does not work for update. This is due to the fact that the underlying implementation uses CachedReader object which overwrites any updated resources unless a mutating function is passed to CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object, f MutateFn) (OperationResult, error).
Logs
No response
Expected Behavior
Either:
Steps To Reproduce
No response
Versions
master, latest