fix(dns_record): unify dynamic flags type in list data source - #7088
Open
SAY-5 wants to merge 1 commit into
Open
fix(dns_record): unify dynamic flags type in list data source#7088SAY-5 wants to merge 1 commit into
SAY-5 wants to merge 1 commit into
Conversation
Records returned by the dns_records data source can have differing concrete underlying types for data.flags (CAA records carry a number while A records omit the field and decode as a typeless dynamic null). Terraform's list serialiser requires a uniform element type, so the differing per-record types crashed the provider with 'inconsistent list element types'. Normalise the dynamic flags so every element exposes the same underlying type before constructing the list. Closes cloudflare#7004 Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
SAY-5
force-pushed
the
fix/dns-records-datasource-7004
branch
from
May 31, 2026 02:34
23ba1ad to
cb7889b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #7004.
The
cloudflare_dns_recordsdata source crashed when a zone contained both an A record and a CAA record. CAA records carry a numericdata.flagswhile A records omit the field, which decoded as a typeless dynamic null. Terraform's list serialiser requires every list element to share a single concrete type, so the differing per-record flags types producedinconsistent list element types (... "flags":cty.DynamicPseudoType ...) then (... "flags":cty.Number ...)and aborted the read.Normalise the dynamic flags after page accumulation: when any sibling exposes a concrete underlying type (Float64 or String, the subtypes already permitted by the schema validator), rewrap typeless null elements as a typed null of the same type so the resulting list has a uniform element type.
The fix is scoped to the list data source's
Readpath; resource and singular data source code paths are untouched. Existing dns_record schema/unit tests pass.