cloudflare_record: check record.Priority
using the API, not the schema
#992
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.
Following on from the changes in 2.19.0 (and 2.19.1 to actually ship the
change), a regression was introduced that is inadvertantly causing a
panic due to the
d.GetOkExists
failing to accurately determine when toapply the
record.Priority
value to the state.d.GetOkExists
is documented as:While the value isn't a bool, it acts similarly as 0 in this context is
both a valid value and a zero value for the field.
To combat the panic, I've swapped the check to instead compare the value
provided by the API to determine whether or not we want to set it. This
approach wasn't initially taken as the API used to return 0 in all cases
where the value wasn't explicitly set and the underlying library would
ignore it. Hopefully, with MX records allowing 0, this is no longer an
issue going forward.
Closes #988