-
Notifications
You must be signed in to change notification settings - Fork 399
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
NEW PROVIDER: AutoDNS #1336
NEW PROVIDER: AutoDNS #1336
Conversation
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.
Looking good so far!
providers/autodns/api.go
Outdated
}) | ||
|
||
responseData, err := api.request("POST", "zone/_search", request) | ||
|
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.
style: remove blank between verb and error checking.
return nil, err | ||
} | ||
|
||
var responseData, _ = api.request("GET", "zone/" + domain + "/" + systemNameServer.Name, nil) |
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 check the error or include a comment explaining why it can be ignored.
Looking great so far! When you're ready for a full review, please post the output of the integration test as a comment. |
Erhm...
|
Woops, missed a spot...
|
The |
providers/autodns/api.go
Outdated
return responseObject.Data[0], nil | ||
} | ||
|
||
func (api *autoDnsProvider) updateZone(domain string, resourceRecords []*ResourceRecord, nameServers []*models.Nameserver, zoneTTL 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.
Add an error return value to this function signature. Then it doesn't need to panic, it can return the error.
That should be the complete suite @tlimoncelli, I've removed the It seems to fail on dual provider support, is it possible to annotate missing support for this using capabilities like other records? |
Congrats! You've passed the biggest challenge!
I thought there was but I can't find anything other that I've started #1345 which will skip that test if |
Hi @tlimoncelli,
It still seems to fail one specific check, can you point me to where that would be? |
Look at Line 758 of |
I didn't even know about this 😲 besides learning Go this also lets me find out stuff about DNS I didn't know about :) Surprisingly AutoDNS seems to support RFC 7505 through the web-interface so I'll try to figure out which edge case in my code is causing this to fail. |
Sounds good! (the amount one can learn about DNS is... infinite :) ) RFC 7505 isn't used by anyone as far as I can tell. Feel free to just add the provider's name to the opt-out list and fix this later. Best, |
I think I found the issue, in https://github.com/arnoschoon/dnscontrol/blob/master/providers/autodns/types.go#L16 the property is omitted if empty (which 0 seems to be), in that case AutoDNS defaults to a value of My laptop is currently churning through 1200+ DNS zones so I'll take a crack at fixing it tomorrow. I'd like to fix it rather than skipping a test even if almost no one uses it :) hopefully that helps with other glitches that'll be discovered in the future. |
Sounds like a good plan! Tom |
Friendly ping? |
Hi @tlimoncelli , sorry for the delay, I got caught up in other work and almost forgot about this. Sadly I had to skip that specific test, at least for now. Passing even an empty
|
I'm reviewing https://stackexchange.github.io/dnscontrol/writing-providers it looks like we skipped most of Step 8. Please update README.md, docs/provider-list.md, and docs/_providers/PROVIDERNAME.md Thanks! |
golint reports:
|
* Implement AutoDNS provider to manage existing zones * Moved AuditRecords() in to separate file to ease automatic updating * S1011 - Use a single append to concatenate two slices * Set list of available record types as returned by the system * Fixed style, clarify code and add some extra comments * Documented simple configuration and usage example of AutoDNS * Convert MX and SRV record properly from string to actual structs and back * Add support for integration tests of AutoDNS * Return error message from update request instead of invoking panic() * Skip AUTODNS in test for RFC 7505 (null MX) * Update providers/autodns/autoDnsProvider.go Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This initial implementation allows you to manage a zone hosted by AutoDNS. A full zone update is performed in case of a modification instead of sending individual change requests.
The desired TTL of the zones' (apex) nameservers is stored as TTL for the SOA record, AutoDNS doesn't let you specify a TTL for these records.
Currently a rather naive approach is used to set the nameservers (which AutoDNS expects in a certain order), for that reason this provider can't be used in conjunction with others.