fix: support AAAA records properly - #98
Conversation
Records() only ever returned A, TXT and CNAME recordsets from Designate. Any existing AAAA recordset was invisible to external-dns's planner, so it treated it as permanently missing and retried CreateRecordSet every sync interval, failing forever with 409 duplicate_recordset once the record already existed. Also adds a devstack integration check that seeds an AAAA recordset directly in Designate and asserts the webhook's GET /records reports it back. The existing checks only ever exercise A/TXT since external-dns's fake source never emits AAAA, so they wouldn't have caught this bug.
external-dns's endpoint.NewEndpointWithTTL trims the trailing dot from DNSName, so the /records response has "aaaa-webhook-test.example.com" without a trailing dot, not "aaaa-webhook-test.example.com.". The AAAA fix itself was correct - confirmed by the actual CI run, which showed the record present in the response before this assertion rejected it.
frittentheke
left a comment
There was a problem hiding this comment.
Thanks a ton for your time and contribution.
Adding AAAA support is long time due!
| # external-dns's `fake` source only ever produces A records, so the checks above never | ||
| # exercise AAAA handling. Regression test for a bug where the webhook's Records() call | ||
| # silently dropped AAAA recordsets, so external-dns would never see an AAAA record as | ||
| # already existing and would loop forever trying (and failing) to recreate it. Designate | ||
| # itself already had the record correctly, so `openstack recordset list` alone can't catch | ||
| # this - the bug is specifically in what the webhook reports back over its own API. |
There was a problem hiding this comment.
thanks for not just not testing things, but for thinking outside the box to work around external-dns in this case. But actually the Fake source does support other record types, see kubernetes-sigs/external-dns#6308.
I know this has not made it into a release, but 0.22 is indeed planned: kubernetes-sigs/external-dns#6607
| Records: []string{"10.1.1.2"}, | ||
| }) | ||
| rs15ID, _ := client.CreateRecordSet(ctx, zone1ID, recordsets.CreateOpts{ | ||
| Name: "www6.example.com.", |
There was a problem hiding this comment.
I know we are not yet following this yet, but I'd like to use the test. TLD as per RFC 6761.
See my PR about changing the other occurrences: #74
Edit: I know the Fake source of external-dns does only create "example.com" records though.
Currently, the webhook creates AAAA records but doesn't return them, resulting in an error loop.
This fixes that and adds a test in the devstack action.