controller-runtime
controller-runtime copied to clipboard
✨ custom equalities in CreateOrUpdate
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