Skip to content
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

Add support for MX and SRV records in pdns provider #4648

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

saravanan30erd
Copy link
Contributor

@saravanan30erd saravanan30erd commented Aug 1, 2024

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

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 1, 2024
@k8s-ci-robot
Copy link
Contributor

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. 😃

@k8s-ci-robot
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 1, 2024
@saravanan30erd saravanan30erd changed the title Add trailing dot for MX and SRV records in pdns provider Add support for MX and SRV records in pdns provider Aug 1, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 2, 2024
@mloiseleur
Copy link
Contributor

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 ?

@saravanan30erd
Copy link
Contributor Author

@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 #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

@mloiseleur
Copy link
Contributor

@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.

@saravanan30erd
Copy link
Contributor Author

@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.

@saravanan30erd
Copy link
Contributor Author

@mloiseleur I have updated the test cases for this change. Please review it, thanks.

@mloiseleur
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 12, 2024
@saravanan30erd
Copy link
Contributor Author

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.

@mloiseleur
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 14, 2024
@mloiseleur
Copy link
Contributor

mloiseleur commented Aug 14, 2024

@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.

@saravanan30erd
Copy link
Contributor Author

saravanan30erd commented Aug 14, 2024

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

@saravanan30erd
Copy link
Contributor Author

@Raffo @szuecs When you have a moment, kindly please review this PR.

@saravanan30erd
Copy link
Contributor Author

@Raffo Gentle Reminder. I wanted to kindly check if you’ve had a chance to review this PR.

@Raffo
Copy link
Contributor

Raffo commented Oct 3, 2024

/approve

@k8s-ci-robot
Copy link
Contributor

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 3, 2024
@k8s-ci-robot k8s-ci-robot merged commit 25b44e5 into kubernetes-sigs:master Oct 3, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PDNS MX record creation failed due to missing trailing .
4 participants