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 and use a deduplicating source #185

Merged
merged 2 commits into from
May 5, 2017
Merged

add and use a deduplicating source #185

merged 2 commits into from
May 5, 2017

Conversation

linki
Copy link
Member

@linki linki commented May 3, 2017

This provides an alternative solution to #182 by using a deduplicating source on the outer edge of the sources chain.

Let me know what you think about this and which approach you prefer compared to #183.

However, as Sources were intended to be extensible a DedupSource doesn't harm and might come in handy in any case.

/cc @jrnt30 @ideahitme

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 3, 2017
@hjacobs
Copy link
Contributor

hjacobs commented May 3, 2017

We definitely should add logging (at least debug).

@jrnt30
Copy link
Contributor

jrnt30 commented May 4, 2017

This is a cleaner abstraction, thanks for doing that.

I agree that having the logging in if there is another record for the DNS entry with a different Target though would be desirable for a debugging/usability standpoint.

@jrnt30 jrnt30 mentioned this pull request May 4, 2017
}

for _, ep := range endpoints {
identifier := ep.DNSName + " / " + ep.Target

Choose a reason for hiding this comment

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

flaky I would say, especially since we don't do any sanitisation on hostnames at all.

Choose a reason for hiding this comment

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

uglier, but more bullet-proof would be collected := map[string]map[string]bool{} or map[string][]string :(

Copy link
Member Author

@linki linki May 5, 2017

Choose a reason for hiding this comment

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

How would a nested map make it more bullet-proof? E.g. the sanitization issue you mention still applies, right?

Choose a reason for hiding this comment

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

yup, you are right. probably potential issues with sanitisation can be postponed as well :)

@ideahitme
Copy link

small comment above, otherwise LGTM

@ideahitme
Copy link

ideahitme commented May 4, 2017

Just a note that the current PR has a different purpose than #183 . This PR resolves the harmless case when two resources have same target and DNS names, hence can and should be deduplicated.

This #183 on the other hand aims to resolve a bigger problem of clashing DNS names, however is initially aimed at resolving #182, which is resolved by this PR in a simpler way :)

@ideahitme
Copy link

👍

@ideahitme ideahitme added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 5, 2017
@linki linki merged commit c124241 into kubernetes-sigs:master May 5, 2017
@linki linki deleted the dedup-source branch May 5, 2017 12:59
ffledgling pushed a commit to ffledgling/external-dns that referenced this pull request Jan 18, 2018
* feat: add and use a deduplicating source

* chore: add log entry when endpoint was deduplicated
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. lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants