-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/powerdns: Add support for PowerDNS 4 API #7819
Conversation
and update the endpoint URL accordingly
See PowerDNS/pdns@f0e76ce for the change in the pdns repository.
Hi @smuth4 Thanks for the work here - will this PR allow the PowerDNS provider to work with both 3 and 4 version servers? Paul |
@stack72 Yes, I ran the acceptance tests against a version 3 server to make sure. There are a few differences in the 4.X API that it doesn't handle automagically, but it is API-compatible with both versions. |
Hi @smuth4 Ok, I have also tested this ran against out current test framework for PowerDNS :)
Thanks so much for the work here ! LGTM so merging |
Thanks @smuth4 I've been waiting for this PR for quite some time now and this will address a lot of my infra build with PDNS 4.x Much appreciated. |
@@ -111,6 +124,26 @@ func parseId(recId string) (string, string, error) { | |||
} | |||
} | |||
|
|||
// Detects the API version in use on the server |
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 piece of code is breaking my .tf deployment as it tries to detect the API version before we launch the instance where PDNS is going to be hosted: here is my provider's config and you can see that my powerdns_server_url link is a place holder of a resource that will be created:
# Power DNS Provider
provider "powerdns" {
api_key = "${var.pdns_api_key}"
#server_url = "http://${openstack_compute_instance_v2.admin_node.floating_ip}:8081"
}
obviously my terraform plan is failing with:
Error refreshing state: 1 error(s) occurred:
* Error setting up PowerDNS client: Error during parsing request URL: parse http://${openstack_compute_instance_v2.admin_node.floating_ip}:8081/api/v1/servers: invalid character "{" in host name
Wouldn't be better to check the server API version prior creating the records?
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This adds support for the non-experimental API present in PowerDNS 4, while retaining support for 3.X, with minimal changes.
Notes:
.
to all DNS names (including in the records), they all succeeded against an actual 4.0.0 serverIf the plan is to drop 3.X entirely, I don't mind fixing those two things up, but that's not a decision I wanted to make alone.
Fixes #6056