fix: resolve DNS record churning caused by Records/AdjustEndpoints - #30
Merged
Merged
Conversation
…smatch Records() returned DNS names without trailing dots and SRV targets without the priority field, while AdjustEndpoints() canonicalized names with trailing dots and external-dns expected 4-part SRV targets. This mismatch caused external-dns to detect "changes" on every sync cycle, resulting in constant create/update/delete API churn. Changes: - Add trailing dot to DNSName in convertRecordToEndpoint to match AdjustEndpoints canonicalization - Reassemble SRV priority (stored as separate API field by Rackspace) into the "priority weight port target" format external-dns expects - Add table-driven tests for trailing dot, SRV format, NS/SOA filtering, TXT label parsing, domain filtering, dry run, and Records/AdjustEndpoints idempotency
AdjustEndpoints was adding trailing dots to DNS names, normalizing TTL from 0 to 300, and stripping quotes from TXT targets. These transformations created mismatches between what Records() returned and what external-dns expected, causing every record to be updated on every sync cycle. Per the external-dns webhook contract, AdjustEndpoints should be a pass-through unless provider-specific canonicalization is needed. Additionally, Records() returned one endpoint per Rackspace record, but external-dns expects one endpoint per name+type with all targets merged. Changes: - Make AdjustEndpoints a pass-through (matches BaseProvider default) - Merge records with same name+type into single multi-target endpoints - Reassemble SRV priority into the target string (Rackspace stores it as a separate API field) - Skip JSON unmarshal on non-JSON TXT record comments - Add request logging to all webhook handlers
skrobul
approved these changes
Apr 23, 2026
cardoe
approved these changes
Apr 24, 2026
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.
AdjustEndpoints was adding trailing dots to DNS names, normalizing TTL
from 0 to 300, and stripping quotes from TXT targets. These
transformations created mismatches between what Records() returned and
what external-dns expected, causing every record to be updated on every
sync cycle. Per the external-dns webhook contract, AdjustEndpoints
should be a pass-through unless provider-specific canonicalization is
needed.
Additionally, Records() returned one endpoint per Rackspace record, but
external-dns expects one endpoint per name+type with all targets merged.
Changes:
as a separate API field)