-
Notifications
You must be signed in to change notification settings - Fork 272
Description
We have noticed that the Code Generator is currently generating code that includes all Custom Resource fields in update requests, even if the field values have not changed. This is causing some update requests to fail, as some APIs reject calls that attempt to set certain fields together, even if only one of them has actually changed.
This issue was observed with the mq
, lambda
, and eventbridge
controllers, and we are aware that other controllers might be impacted as well.
We would like to request that the Code Generator consider generating code that only includes fields in update requests if their values have actually changed. One possible solution to this issue would be to add a generation configuration called fine_grained_update_requests <boolean>
that instructs the code generator to generate code that checks whether a field has changed (as indicated by its inclusion in the delta
object) before setting it in the SDK
request. This would prevent unnecessary update requests from failing and improve the reliability of our code.
Steps to reproduce:
- Use the Code Generator to generate code for updating a Custom Resource.
- Observe that the generated code includes all Custom Resource fields in the update request.
- Attempt to update a resource using the generated code, and observe that the request fails due to unnecessary fields being included.
Actual behavior:
- Update requests currently include all Custom Resource fields, regardless of whether their values have changed. This can cause update requests to fail.