Bug: Some logging providers were sending an empty placement
to the Fastly API
#620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
When creating a logging provider the
placement
attribute is optional and the API will expect it to not be sent with an empty value, but that is what was happening in the latest Terraform v3 release.Context :
The Terraform provider wraps all values in a pointer (as that is what go-fastly v7+ expects), but the zero value for an attribute (e.g.
""
for the string type) is what will be wrapped inside the pointer and consequently sent to the API via go-fastly. Previously we had used the integration/acceptance tests to identify which attributes would cause API errors but what happened in this instance was that the tests were setting a value for that field and so no error was reported.Solution:
Do as we have already done with the other logging providers and avoid setting the
placement
field on the go-fastly struct.