The Host field of the HTTP request is set incorrectly when passing
the configured server. The underlying HTTP library experts a hostname
to be passed. When passing it a string of the form 'http://pdns.example.com'
this gets converted into 'http:' (stripping everything from the first
slash onward). However setting the Host field in the pdnsClientConfig
object is not needed because the underlying library will then parse the
hostname from the URL.
Fixes#661
Signed-off-by: Bartel Sielski <bartel.sielski@gmail.com>
* Fixed PowerDNS provider bug affecting endpoint conversion to
zone in a particular case
* Added a regressive test case, covered an additional case
PowerDNS provider bug: In the function ConvertEndpointsToZones,
the endpoints are sorted lexicographically increasing
(and by record type in case of match). The zones are sorted by
decreasing order of length. There's a loop through of zones
under which the code loops through endpoints. In the case
the first endpoint does not match with the first zone,
the complete zone won't get populated with any endpoints.
Commit adds:
* Implementation of PowerDNS as a provider
* Tests for said implementation
* github.com/ffledgling/pdns-go, which provides go client bindings for
PowerDNS's HTTP API, as a dependency
* "pdns" as an additional option for the `--provider` flag
* `--pdns-server` and `--pdns-api-key` as additional flags for PowerDNS
specific configuration