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

Allow ZoneIDFilter for Cloudflare #1307

Closed
wants to merge 2 commits into from

Conversation

dmizelle
Copy link
Contributor

@dmizelle dmizelle commented Dec 3, 2019

Additionally:

  • add a .dockerignore so we don't copy .git and docs to the
    container (gotta go fast)
  • Change Dockerfile{,.mini} to not run go mod every time a file is
    changed.

This commit should help with #1127. While users in the past were able to
define ZoneIDFilter for this provider, it did not actually do anything
under the hood.

In this case, we're changing Zones() to iterate over the provided
zoneIDs and return only those zones.

I would have also done this for domainFilter, but unfortunately the
CloudFlare API requires that in order to list zones (and find them by
name) that you have "all" permissions, which seems silly. After talking
to their support, this is probably the best way to do this.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Dec 3, 2019
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Dec 3, 2019
@k8s-ci-robot
Copy link
Contributor

Welcome @dmizelle!

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dmizelle
To complete the pull request process, please assign linki
You can assign the PR to them by writing /assign @linki in a comment when ready.

The full list of commands accepted by this bot can be found 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 3, 2019
Additionally:
* add a .dockerignore so we don't copy .git and docs to the
  container (gotta go fast)
* Change Dockerfile{,.mini} to not run `go mod` every time a file is
  changed.

This commit _should_ help kubernetes-sigs#1127. While users in the past were able to
define ZoneIDFilter for this provider, it did not actually do anything
under the hood.

In this case, we're changing Zones() to iterate over the provided
zoneIDs and return only those zones.

I would have also done this for domainFilter, but unfortunately the
CloudFlare API requires that in order to list zones (and find them by
name) that you have "all" permissions, which seems silly. After talking
to their support, this is probably the best way to do this.
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Dec 3, 2019
@dmizelle
Copy link
Contributor Author

dmizelle commented Dec 3, 2019

signed cla!

@dmizelle
Copy link
Contributor Author

dmizelle commented Dec 3, 2019

/check-cla

Copy link
Member

@njuettner njuettner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR 👍

Some nits, but other than that lgtm.
You might also want recheck the CLA 🙂.

@@ -16,10 +16,13 @@
FROM golang:1.13 as builder

WORKDIR /github.com/kubernetes-sigs/external-dns
COPY go.mod .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave the the Dockerfile changes out of this PR, the PR should only focus on the Cloudflare changes like in the title.
But feel free to create a separate PR.

@@ -486,6 +528,23 @@ func TestCloudFlareZones(t *testing.T) {
})
}

func TestCloudFlareZonesWithIDFilter(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an additional test wich has both domainFilter and zoneIDFilter?

@njuettner
Copy link
Member

@dmizelle I will close this PR since it has no progress, if you have time please reopen a PR and check you CLA.

@njuettner njuettner closed this Jan 9, 2020
@k8s-ci-robot
Copy link
Contributor

@dmizelle: PR needs rebase.

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/test-infra repository.

@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 9, 2020
drGrove added a commit to drGrove/external-dns that referenced this pull request Apr 8, 2020
Signed-off-by: Danny Grove <danny@drgrovellc.com>
drGrove added a commit to drGrove/external-dns that referenced this pull request Apr 8, 2020
This is based off the work found in kubernetes-sigs#1307 that was never merged. It
moves around the install and copy of certain conponents to take better
advantage of the Docker cache ad well as drops running tests during the
build of the image.

The reason for dropping tests is to improve build time and as running
tests within the build while they're already being run in CI seems like
an unnecessary added tax.

Signed-off-by: Danny Grove <danny@drgrovellc.com>
drGrove added a commit to drGrove/external-dns that referenced this pull request Jun 18, 2020
This is based off the work found in kubernetes-sigs#1307 that was never merged. It
moves around the install and copy of certain conponents to take better
advantage of the Docker cache ad well as drops running tests during the
build of the image.

The reason for dropping tests is to improve build time and as running
tests within the build while they're already being run in CI seems like
an unnecessary added tax.

Signed-off-by: Danny Grove <danny@drgrovellc.com>
drGrove added a commit to drGrove/external-dns that referenced this pull request Aug 25, 2020
This is based off the work found in kubernetes-sigs#1307 that was never merged. It
moves around the install and copy of certain conponents to take better
advantage of the Docker cache ad well as drops running tests during the
build of the image.

The reason for dropping tests is to improve build time and as running
tests within the build while they're already being run in CI seems like
an unnecessary added tax.

Signed-off-by: Danny Grove <danny@drgrovellc.com>
drGrove added a commit to drGrove/external-dns that referenced this pull request Oct 2, 2020
This is based off the work found in kubernetes-sigs#1307 that was never merged. It
moves around the install and copy of certain conponents to take better
advantage of the Docker cache ad well as drops running tests during the
build of the image.

The reason for dropping tests is to improve build time and as running
tests within the build while they're already being run in CI seems like
an unnecessary added tax.

Signed-off-by: Danny Grove <danny@drgrovellc.com>
drGrove added a commit to drGrove/external-dns that referenced this pull request Oct 26, 2020
This is based off the work found in kubernetes-sigs#1307 that was never merged. It
moves around the install and copy of certain conponents to take better
advantage of the Docker cache ad well as drops running tests during the
build of the image.

The reason for dropping tests is to improve build time and as running
tests within the build while they're already being run in CI seems like
an unnecessary added tax.

Signed-off-by: Danny Grove <danny@drgrovellc.com>
drGrove added a commit to drGrove/external-dns that referenced this pull request Feb 8, 2021
This is based off the work found in kubernetes-sigs#1307 that was never merged. It
moves around the install and copy of certain conponents to take better
advantage of the Docker cache ad well as drops running tests during the
build of the image.

The reason for dropping tests is to improve build time and as running
tests within the build while they're already being run in CI seems like
an unnecessary added tax.

Signed-off-by: Danny Grove <danny@drgrovellc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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

3 participants