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

Update cloudflare-go to 0.58.1 #3288

Merged
merged 4 commits into from
Jan 17, 2023

Conversation

arturhoo
Copy link
Contributor

@arturhoo arturhoo commented Jan 5, 2023

Description

Update cloudflare-go to the latest version.
There are breaking changes between 0.50.0 and 0.58.0 introduced in cloudflare/cloudflare-go#1151 that change the method signatures used in the provider.

I tried to minimize the changes here, by keeping the 'generic' cloudFlareChange struct that encapsulates cloudflare.DNSRecord and is used to keep track of changes needed. Only by the time that we actually call the cloudflare library functions that we convert from the generic container to the newly specialized ones (cloudflare.UpdateDNSRecordParams, cloudflare.CreateDNSRecordParams) through a generic function.

The alternative would've have been to split the slice of type []*cloudFlareChange{} into perhaps a map that contains several change types holding the new parameter types.

Why make this change?

Since version 0.58.0, the cloudflare-go library has a PerPage attribute on cloudflare.ListDNSRecordsParams which will 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-records

Passing in the max allowed value (or parameterizing it) will be done in a follow-up PR: https://github.com/arturhoo/external-dns/compare/cloudflare-go-0.58.0...arturhoo:external-dns:cloudflare-paginated-list-requests?expand=1

Checklist

  • Unit tests updated
  • End user documentation updated (N/A)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 5, 2023
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 5, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @arturhoo!

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 k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 5, 2023
@arturhoo arturhoo changed the title Update cloudflare-go to 0.58.0 Update cloudflare-go to 0.58.1 Jan 5, 2023
@arturhoo arturhoo marked this pull request as ready for review January 5, 2023 12:22
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 5, 2023
@arturhoo arturhoo force-pushed the cloudflare-go-0.58.0 branch 2 times, most recently from 36fec31 to e2ff260 Compare January 5, 2023 16:37
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 5, 2023
@szuecs
Copy link
Contributor

szuecs commented Jan 6, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /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 Jan 6, 2023
@szuecs
Copy link
Contributor

szuecs commented Jan 6, 2023

/assign @njuettner

@szuecs
Copy link
Contributor

szuecs commented Jan 6, 2023

I am not yet allowed to press the test run button

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2023
Artur Rodrigues added 3 commits January 9, 2023 10:16
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>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2023
@arturhoo
Copy link
Contributor Author

@njuettner would you be able to help with the approval for running the test workflows? I suppose this PR also needs a lgtm.
Happy to make adjustments if necessary.

Once this gets merged, I'll create a PR for the changes in https://github.com/arturhoo/external-dns/compare/cloudflare-go-0.58.0...arturhoo:external-dns:cloudflare-paginated-list-requests?expand=1 - thanks

@Raffo
Copy link
Contributor

Raffo commented Jan 16, 2023

@arturhoo can you fix the CI errors (linting).

@Raffo
Copy link
Contributor

Raffo commented Jan 17, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 17, 2023
@k8s-ci-robot k8s-ci-robot merged commit 8c2d545 into kubernetes-sigs:master Jan 17, 2023
@arturhoo arturhoo deleted the cloudflare-go-0.58.0 branch January 30, 2023 10:09
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. 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.

None yet

5 participants