controller-runtime icon indicating copy to clipboard operation
controller-runtime copied to clipboard

✨ custom equalities in CreateOrUpdate

Open tareksha opened this issue 1 year ago • 9 comments

Currently CreateOrUpdate always uses equalities.Semantic to decide whether an update is needed after mutating the existing object. Sometimes custom behavior is needed, for example when some fields are protobuf types (proto.Message).

Add CreateOrUpdateWithEqualities to allow passing a custom Equalities for performing the deepEqual comparison. The existing CreateOrUpdate continues to use equalities.Semantic.

Without this fix CreateOrUpdate always updates resources that contain fields with types that Semantic does not support as-is, even when not needed

tareksha avatar Feb 02 '24 15:02 tareksha