Closed
Description
The controllerutil.CreateOrUpdate does not correctly handle updates.
Given the same resource multiple times, CreateOrUpdate
will always perform an UPDATE api call, and report that it did so, even if there were no updates to the resource. This can be easily verified by making the following modifcation to the unit test
This diff results in the following error:
This is problematic:
- It result in unnecessary API calls,
- It reduces visibility into what a controller is doing. The function suggests that it will return OperationNone if no changes were made, however controller authors still need to manually check if their resource changed. This reduces the ability to properly log and emit metrics, as well as other problems such as those offered in CreateOrUpdate falsely claiming its updating resources #847 (comment)
Root Cause in this comment:
Metadata
Metadata
Assignees
Labels
No labels