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

Ignore unknown provider specific properties #4669

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kevinfrommelt
Copy link

@kevinfrommelt kevinfrommelt commented Aug 9, 2024

Description

Currently if an endpoint contains a provider specific property for a provider other than the currently configured provider, the current provider will still consider it in the desired state. This will cause the endpoint to be marked as needing an update because when the provider loads the actual state it will never have that specific property set (ie. the desired and actual state never match). This causes unnecessary updates to be made on every sync.

This PR updates the providers to only consider its own specific properties (ie. ignore properties for other providers).

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 9, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @kevinfrommelt!

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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 9, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @kevinfrommelt. 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 the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 9, 2024
@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 13, 2024
@mloiseleur
Copy link
Contributor

Mmmh 🤔 I guess it's also the case for other providers.
@kevinfrommelt Do you think you can update this PR to solve this for all providers ?

@kevinfrommelt
Copy link
Author

@mloiseleur Yea I can give it a shot.

@kevinfrommelt
Copy link
Author

@mloiseleur Before I go through every provider, what do you think of this approach?
master...kevinfrommelt:external-dns:ignore-other-provider-properties
It applies a filter to the BaseProvider, which can be overridden by other providers.

@mloiseleur
Copy link
Contributor

At first glance, it should do it 👍 !

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign raffo for approval. For more information see the Kubernetes Code Review Process.

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 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 31, 2024
@kevinfrommelt kevinfrommelt changed the title aws: Ignore non-aws specific properties Ignore unknown provider specific properties Aug 31, 2024
@kevinfrommelt
Copy link
Author

@mloiseleur I've updated this to cover all providers. This ready for another review.

@mloiseleur
Copy link
Contributor

@kevinfrommelt You'll need to add test for endpoint/provider_specific_property_filter.go

Btw, wdyt of logging a warning when there is property not related to the provider ? Is there legitimate / expected use cases where it happens ?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 17, 2024
@kevinfrommelt kevinfrommelt force-pushed the aws-ignore-other-specific branch from c4fcd5c to 2b59ea5 Compare October 11, 2024 14:50
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed 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. labels Oct 11, 2024
@kevinfrommelt
Copy link
Author

Hey @mloiseleur, sorry for delay. I have rebased onto latest, added tests for endpoint/provider_specific_property_filter.go, and added a debug log for properties that get ignored by the provider.

is there legitimate / expected use cases where it happens ?

As far as I could tell the providers were already ignoring all the properties they didn't have defined. The extra properties were just throwing off the comparison between the desired and actual states of the endpoints, which was triggering the provider to do a no-op update on every sync.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 5, 2024
@kevinfrommelt kevinfrommelt force-pushed the aws-ignore-other-specific branch from a1af633 to ec732b3 Compare November 8, 2024 14:14
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 8, 2024
@kevinfrommelt
Copy link
Author

@mloiseleur Just checking in to see if you've had a chance to look at this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants