-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDNS: add support for LOC records #3127
Conversation
Thanks! |
Please add a comment with the output of the integration tests (redact as needed) |
95499d0
to
af1eabe
Compare
case "NAPTR": | ||
rc.SetTargetNAPTRStrings(r.NaptrOrder, r.NaptrPref, r.NaptrFlag, r.NaptrParams, r.NaptrRegexp, r.NaptrReplace+".") | ||
case "LOC": | ||
loc := fmt.Sprintf("%s %s %s %s %s %s %s %s %s %s %s %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should be redundant now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think specifically the part that strips the decimal part of altitude is redundant? The rest has to remain as I need to assemble the LOC record from the individual API parts.
Better to call calculateLOCFields
directly, but then I would have to duplicate the string to int/float conversions as the API returns strings for everything, despite being JSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to call
calculateLOCFields
directly, but then I would have to duplicate the string to int/float conversions as the API returns strings for everything, despite being JSON.
🤦
I don't know what to say. But coercing as early as possible is safest, especially when working with numbers and maths.
Oops, I forgot the unit tests. This showed up an interesting quirk with CLOUDNS's handling of the size/precision fields - it quietly substitutes its own default values if you pass "0.00", even though those are documented as valid! I've put in a workaround. |
All tests are passing now except the NAPTR test. The CLOUDNS API is rejecting records with both
|
0a88d4d
to
3e795b4
Compare
Can you supply nothing?
|
Seems pretty wild. Both are necessary for a functioning NAPTR pointer. Flag an error with their support. Edit: actually, the regexp can do both. But which format don't they like from those available here? https://docs.dnscontrol.org/language-reference/domain-modifiers/naptr Recommend that you separate out NAPTR changes to a separate PR if you think this could take a while to resolve. |
It turns out that the weird behaviour with "0.00" also applies to the altitude field. If I supply nothing, I get the default of 10,000m. 😕 |
3e795b4
to
6efaa96
Compare
Done. Once your #3130 is merged I will submit this PR. |
6efaa96
to
0c65eb0
Compare
I've stripped out the NAPTR code for now, and updated this for @systemcrash 's decimal LOC changes. All the unit tests are passing, so I think this is ready to go! Thanks all for review and assistance. |
Sorry lads, I've no experience with cloud but your approach looks sound. 🤓
|
Hi @tlimoncelli I think this is ready to go now. Thanks. |
Thanks! |
@hmoffatt have your changes proved beneficial? |
My interest in this was academic tbh, just learning my way around Go and the dnscontrol codebase. |
This PR adds support for NAPTR and LOC records on CLOUDNS.