external-dns
external-dns copied to clipboard
Add support for MX and SRV records in pdns provider
Description
This PR enables MX and SRV record support for PowerDNS provider in ExternalDNS. Especially for PowerDNS API, it requires explicit trailing dot for records having FQDN such as CNAME, MX, SRV, etc.. For CNAME record, its already covered here https://github.com/kubernetes-sigs/external-dns/blob/master/provider/pdns/pdns.go#L317-L318 so I added trailing dot for MX and SRV records now.
Errors Fixed
Error from PDNS API for SRV record creation
level=debug msg="PDNS API response:
level=fatal msg="Failed to do run once: Status: 422 Unprocessable Entity, Body: {\"error\": \"Record _service._tls.example.com./SRV '100 1 443 service.example.com': Not in expected format (parsed as '100 1 443 service.example.com.')\"}"
Error from PDNS API for MX record creation
level=fatal msg="Failed to do run once: Status: 422 Unprocessable Entity, Body: {\"error\": \"Record test.example.com./MX '10 mailhost1.example.com': Not in expected format (parsed as '10 mailhost1.example.com.')\"}
The above errors is fixed by this PR.
Fixes #3930 #4267
Checklist
- [x] Unit tests updated
- [x] End user documentation updated
Welcome @saravanan30erd!
It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
Hi @saravanan30erd. Thanks for your PR.
I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
I'm not sure to understand the context of this PR. Are you saying that, with this PR, it adds a needed trailing dot but it's still failing on PDNS ? Or are you saying that, with this PR, the added trailing dot fix the issue observed with PDNS ?
Anyway, no PR on the code merge without test. So would you please update the tests accordingly ?
@mloiseleur
are you saying that, with this PR, the added trailing dot fix the issue observed with PDNS ?
Yes.
PDNS API expects trailing dot for both these MX and SRV records. Without trailing dots, we are getting the errors mentioned in this issue https://github.com/kubernetes-sigs/external-dns/issues/3930
I have added required trailing dots for these two records now same as CNAME and ALIAS records, after adding trailing dots we can create MX and SRV records in PDNS using external dns without any issues. Trailing dots are added already to CNAME and ALIAS records here https://github.com/kubernetes-sigs/external-dns/blob/master/provider/pdns/pdns.go#L317-L318
@saravanan30erd Then wdyt of rewriting in this PR description "Errors to be fixed" with something like "Fixed errors" ?
Anyway, once it's tested, it can be reviewed.
@mloiseleur
Then wdyt of rewriting in this PR description "Errors to be fixed" with something like "Fixed errors" ?
Done, changed the PR description.
Anyway, once it's tested, it can be reviewed.
Sure, will add the tests.
@mloiseleur I have updated the test cases for this change. Please review it, thanks.
/lgtm
Hi @mloiseleur Thanks for the review.
Is there anything I can do on my end to help move it forward? Please let me know if there's anything I can assist with.
/ok-to-test
@saravanan30erd One of the other maintainer will review it when he has time.
BTW, we have started the process to move the providers out of tree. Feel free to host your own pdns provider.
Thanks, bot told to assign it to @Raffo so assigning it.
Once this PR has been reviewed and has the lgtm label, please assign raffo for approval.
/assign @Raffo
@Raffo @szuecs When you have a moment, kindly please review this PR.
@Raffo Gentle Reminder. I wanted to kindly check if you’ve had a chance to review this PR.
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Raffo
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [Raffo]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment