Skip to content

fix(cloudns): map CLOUD_WR to CLOUDNS_WR so redirect records are not recreated every push#4188

Open
raman1236 wants to merge 1 commit intoDNSControl:mainfrom
raman1236:fix/cloudns-wr-type-mapping
Open

fix(cloudns): map CLOUD_WR to CLOUDNS_WR so redirect records are not recreated every push#4188
raman1236 wants to merge 1 commit intoDNSControl:mainfrom
raman1236:fix/cloudns-wr-type-mapping

Conversation

@raman1236
Copy link
Copy Markdown

Summary

Fixes #3972

CLOUDNS_WR (web redirect) records are destroyed and recreated on every dnscontrol push even when nothing has changed.

Root Cause

When records are fetched from the ClouDNS API, the toRc function converts the API type CLOUD_WR to WR. However, dnscontrol registers the custom record type as CLOUDNS_WR (line 85). This means:

  • Fetched records have type WR
  • Desired records (from user config) have type CLOUDNS_WR

The diff algorithm sees them as different record types and generates a DELETE + CREATE on every push.

Fix

  1. In toRc(): Map CLOUD_WRCLOUDNS_WR (instead of → WR) so fetched records match the registered custom type
  2. In the request builder: Remove WR from the "nothing special" case since the type is now always CLOUDNS_WR (which was already handled in the case below)

Testing

  • Added TestToRcConvertsCloudWRToCloudnsWR unit test that verifies the type mapping
  • Build passes cleanly

…recreated

When fetching records from the ClouDNS API, web redirect records come
back with type "CLOUD_WR". The toRc function was converting this to
"WR" but dnscontrol registers the custom type as "CLOUDNS_WR".

This mismatch caused dnscontrol to see fetched WR records as different
from desired CLOUDNS_WR records, destroying and recreating them on
every push.

Map CLOUD_WR to CLOUDNS_WR in toRc and remove the stale WR entry from
the nothing-special case in the request builder.

Fixes DNSControl#3972
@raman1236
Copy link
Copy Markdown
Author

Friendly ping — this PR fixes the CLOUD_WRCLOUDNS_WR record type mapping so redirect records aren't recreated on every push. Would appreciate a review. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

CLOUDNS_WR (redirect) recreated on every push

2 participants