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

Do a case insensitive match when checking for duplicate FQDNs #3231

Merged
merged 6 commits into from
Jan 11, 2021

Conversation

erwbgy
Copy link
Contributor

@erwbgy erwbgy commented Dec 21, 2020

Do a case insensitive match when checking for duplicate FQDNs to avoid RouteConfiguration failures.

Fixes #3230

Signed-off-by: Keith Burdis keith.burdis@gs.com

…d RouteConfiguration failures.

Signed-off-by: Keith Burdis <keith.burdis@gs.com>
@codecov
Copy link

codecov bot commented Dec 21, 2020

Codecov Report

Merging #3231 (953149c) into main (88805b8) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3231      +/-   ##
==========================================
- Coverage   75.44%   75.42%   -0.02%     
==========================================
  Files          97       97              
  Lines        6022     6023       +1     
==========================================
  Hits         4543     4543              
- Misses       1369     1371       +2     
+ Partials      110      109       -1     
Impacted Files Coverage Δ
internal/dag/httpproxy_processor.go 94.16% <100.00%> (+0.01%) ⬆️
internal/k8s/log.go 63.04% <0.00%> (-6.53%) ⬇️
internal/dag/cache.go 96.04% <0.00%> (+0.79%) ⬆️

Copy link
Member

@youngnick youngnick left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this!

@youngnick
Copy link
Member

We'll need one more review on this one, we recently changed our review settings to require 2 reviews. But this will definitely be in 1.12 (due January 2021).

Copy link
Member

@sunjayBhatia sunjayBhatia left a comment

Choose a reason for hiding this comment

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

Looks got to me, only additional change I could see would be some detail in an error message but given people should know virtual host names should be case insensitive it also seems unnecessary

@jpeach
Copy link
Contributor

jpeach commented Dec 21, 2020

We'll need one more review on this one, we recently changed our review settings to require 2 reviews. But this will definitely be in 1.12 (due January 2021).

Maybe just verify whether we should lowercase the name before sending it to envoy?

@sunjayBhatia
Copy link
Member

General question, are there any higher level tests we should add for this? Worth adding an integration test?

@youngnick
Copy link
Member

Envoy only performs lower-case host name matches itself anyway, so we are not gaining anything by case insensitivity. See envoyproxy/envoy#2412 for the fix there.

@youngnick
Copy link
Member

Seems like there is also currently case sensitivity for SNI hostnames, although it will be changed at some point, see envoyproxy/envoy#6199 for more.

This definitely will require a release note and some explanation, since in the event that people are relying on the non-RFC-compliant case sensitivity we currently have, they need to know.

However, given we have a reasonably important bug here (#3230), we need to have a solution, which this is. I don't feel that we should be tying ourselves in knots to maintain compatibility when that compatibility is against the relevant RFCs anyway. I won't merge this until the new year, to give people a chance to see this PR and comment if it will affect them.

@youngnick youngnick added do not merge Don't merge this PR until this label is removed. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. labels Dec 22, 2020
@erwbgy
Copy link
Contributor Author

erwbgy commented Dec 22, 2020

One thing to note in the release notes is that configuring an FQDN like EXPLORER.domain.com still works after this fix, so won't break any users with uppercase in their URL hostnames. They just won't be able to configure multiple FQDNs that differ only by case.

The multiple case-insensitive FQDNs only works with tcpproxy today and fails when routes are used, so that is the only use-case affected by this change. On the other hand it is trivially easy to accidentally (or on purpose) break a multi-tenant Contour setup, though unlikely (one of our users did it twice).

@stevesloka stevesloka added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jan 4, 2021
@erwbgy erwbgy requested a review from a team as a code owner January 8, 2021 08:03
@erwbgy erwbgy requested review from jpeach and skriss and removed request for a team January 8, 2021 08:03
@youngnick youngnick merged commit 0c73316 into projectcontour:main Jan 11, 2021
@youngnick
Copy link
Member

I munged the commit message a bit, @erwbgy.

erwbgy added a commit to erwbgy/contour that referenced this pull request Jan 14, 2021
…tcontour#3231)

Do a case insensitive match when checking for duplicate FQDNs to avoid RouteConfiguration failures.

Fixes projectcontour#3230.

Signed-off-by: Keith Burdis <keith.burdis@gs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Don't merge this PR until this label is removed. release-note Denotes a PR that will be considered when it comes time to generate release notes. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RouteConfiguration rejected due to duplicate entry
5 participants