-
Notifications
You must be signed in to change notification settings - Fork 594
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
fix: filter hostnames in HTTPRoute #3180
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
randmonkey
force-pushed
the
fix/httproute_incorrect_host
branch
from
November 21, 2022 09:26
6a9dd78
to
2b17cf2
Compare
randmonkey
force-pushed
the
fix/httproute_incorrect_host
branch
from
November 23, 2022 02:51
2b17cf2
to
b1f51f1
Compare
randmonkey
force-pushed
the
fix/httproute_incorrect_host
branch
from
November 23, 2022 06:37
b1f51f1
to
ca83257
Compare
randmonkey
changed the title
[WIP] fix: does not filter hosts when no hosts in httproute
fix: filter hostnames in HTTPRoute
Nov 23, 2022
pmalek
reviewed
Nov 24, 2022
randmonkey
force-pushed
the
fix/httproute_incorrect_host
branch
from
November 29, 2022 10:38
d8712c3
to
8cd4800
Compare
pmalek
reviewed
Nov 29, 2022
pmalek
reviewed
Nov 29, 2022
randmonkey
force-pushed
the
fix/httproute_incorrect_host
branch
from
November 30, 2022 08:28
78ee87f
to
822b933
Compare
pmalek
reviewed
Nov 30, 2022
randmonkey
force-pushed
the
fix/httproute_incorrect_host
branch
from
November 30, 2022 09:56
822b933
to
99c5959
Compare
pmalek
previously approved these changes
Nov 30, 2022
randmonkey
force-pushed
the
fix/httproute_incorrect_host
branch
from
November 30, 2022 17:05
99c5959
to
32b9fb8
Compare
pmalek
approved these changes
Nov 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
HTTPRoute
contains emptyspec.hostnames
, and any of compatible listeners does not specifyhostname
HTTPRoute
could match hostnames in listners, do not accept thisHTTPRoute
: https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPRouteWhich issue this PR fixes:
fixes #3175
Special notes for your reviewer:
According to API specification of gateway APIs, what should do when
HTTPRoute
does not containhostnames
but listeners contains
hostname
is not defined. I think the most reasonable behavior is to match the hostname specified by the listener which theHTTPRoute
attached to. When anHTTPRoute
is not attached to a listener (has emptyparentRef.SectionName
), I think the reasonable behavior is to match UNION of all (compatible) listeners in the gateway. If any of theHTTP
,HTTPS
,TLS
listeners has an empty hostname to match any hostname, the hostname inHTTPRoute
should be also empty to match any hostname.Also, gateway API spec tells that when no hostname in
HTTPRoute
can match hostnames in listeners, theHTTPRoute
should not be accepted.PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR