Conversation
|
By subdomain validation, do you mean they check to see if the ööö.企业. record exists? |
|
I'm sorry, I meant TLD validation, so the 企业 TLD is not in their systems and thus not allowed to be added as a target for a CNAME record. |
|
I reached out to Linode about the TLD. |
| Original: &domainRecord{}, | ||
| }) | ||
| } | ||
|
|
There was a problem hiding this comment.
Add:
// Normalize
models.Downcase(foundRecords)
| MxPreference: uint16(r.Priority), | ||
| SrvPriority: uint16(r.Priority), | ||
| SrvWeight: uint16(r.Weight), | ||
| SrvPort: uint16(r.Port), |
There was a problem hiding this comment.
Could domainRecord use uint32/uint16 instead of int? Then the conversions wouldn't be needed here.
| req.Name = "" | ||
| case "CNAME": | ||
| req.Target = fixTarget(req.Target, dc.Name) | ||
| } |
There was a problem hiding this comment.
Switch statements should list all possible rtypes so that when a new rtype is added, we fail fast. Look at https://github.com/StackExchange/dnscontrol/blob/master/models/dns.go#L90 for an example.
| } | ||
| } | ||
|
|
||
| func fixTTL(ttl uint32) uint32 { |
There was a problem hiding this comment.
If the code modifies TTLs, the docs should make note of that.
| "testing" | ||
| ) | ||
|
|
||
| func TestFixTTL(t *testing.T) { |
There was a problem hiding this comment.
Please add a unit test for {299, ???} (i.e. that way you are testing, n, n-1, and n+1)
(by the way... thank you so much for having unit tests. So few people write them and they are very important for keeping the code maintainable)
74c9adf to
b716bd5
Compare
|
Thanks for the contribution! |
Fixes #121
All tests pass, except for 25 because Linode performs subdomain validation which does not allow the 企业 TLD.