-
Notifications
You must be signed in to change notification settings - Fork 2.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
cloudflare - customizable pagination when listing DNS records #3364
cloudflare - customizable pagination when listing DNS records #3364
Conversation
588c66f
to
f1a966d
Compare
Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>
Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>
Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>
Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>
f1a966d
to
d8bf246
Compare
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.
Why do you need to do a breaking change?
I think we can do better and enable people without breaking their deployments.
/ok-to-test |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: arturhoo, szuecs 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 |
/lgtm |
Description
When listing DNS records in a given zone, by default, the
cloudflare-go
library fetches the results from Cloudflare's APIs in batches of size 50 - traversing the pages is done automatically when callingcloudflare.ListDNSRecordsParams
with no pagination options.However, users that have a large number of records in a zone, and with several deployments of
external-dns
fetching the records for the same zone, risk reaching Cloudflare's API limits.Since version 0.58.0, the
cloudflare-go
library has aPerPage
attribute oncloudflare.ListDNSRecordsParams
which can help reduce the number of API calls made to Cloudflare and prevent rate limit events: https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-recordsThis allows
external-dns
to fetch records in batch sizes of up to 5,000 (from the default 100), potentially reducing the number of API requests by a factor of 50.In this PR, we allow users to tune the
PerPage
parameter. Since auto-pagination is not available when a customPerPage
value is passed tocloudflare.ListDNSRecordsParams
(and the library is unlikely to do so in the future), we perform it ourselves.An old, unused config option around pagination of zones,
CloudflareZonesPerPage
, is also removed - I believe it was supposed to be removed on #2298.Checklist