You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have come across an issue when updating BackendConfig object in GCP. When trying to add values to an array-type field, the request fails with an odd error message about request being invalid.
Based on my investigation, when the array-type field is empty, it gets deleted during apply. If you then try to add a value to it, the json patch that plugin generates, fails due to array field missing. The plugin should check if array field is missing, create it and then execute the original patch.
Issue
I have come across an issue when updating BackendConfig object in GCP. When trying to add values to an array-type field, the request fails with an odd error message about request being invalid.
Based on my investigation, when the array-type field is empty, it gets deleted during apply. If you then try to add a value to it, the json patch that plugin generates, fails due to array field missing. The plugin should check if array field is missing, create it and then execute the original patch.
Plugin just generates this op:
but when
headers
key is missing it should do this first to prevent failed request:Steps to replicate
Option 1
custom_request_headers
section from examplecustom_request_headers
sectionOption 2
headers
array in TF[{"path":"/spec/customRequestHeaders/headers","op":"remove"}]
Workaround
headers
key manually:Test setup
I have tested with versions 1.0.6 and 1.0.2.
Example BackendConfig
Corresponding YAML from API
The text was updated successfully, but these errors were encountered: