-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Linode provider #268
Linode provider #268
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add:
// Normalize
models.Downcase(foundRecords)
providers/linode/linodeProvider.go
Outdated
MxPreference: uint16(r.Priority), | ||
SrvPriority: uint16(r.Priority), | ||
SrvWeight: uint16(r.Weight), | ||
SrvPort: uint16(r.Port), |
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.
Could domainRecord use uint32/uint16 instead of int? Then the conversions wouldn't be needed here.
providers/linode/linodeProvider.go
Outdated
req.Name = "" | ||
case "CNAME": | ||
req.Target = fixTarget(req.Target, dc.Name) | ||
} |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.