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

Gateway API: fix for failing GatewayWithAttachedRoutes conformance test #5961

Merged
merged 14 commits into from
Dec 12, 2023

Conversation

izturn
Copy link
Member

@izturn izturn commented Nov 14, 2023

Signed-off-by: Gang Liu gang.liu@daocloud.io

fix #5920

Signed-off-by: gang.liu <gang.liu@daocloud.io>
Signed-off-by: gang.liu <gang.liu@daocloud.io>
@izturn izturn requested a review from a team as a code owner November 14, 2023 09:59
@izturn izturn requested review from tsaarni and stevesloka and removed request for a team November 14, 2023 09:59
@izturn izturn self-assigned this Nov 14, 2023
@izturn izturn added area/gateway-api Issues or PRs related to the Gateway (Gateway API working group) API. release-note/small A small change that needs one line of explanation in the release notes. labels Nov 14, 2023
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #5961 (1cb7d00) into main (44dd9f4) will decrease coverage by 0.02%.
Report is 5 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5961      +/-   ##
==========================================
- Coverage   78.69%   78.68%   -0.02%     
==========================================
  Files         138      138              
  Lines       19687    19675      -12     
==========================================
- Hits        15493    15481      -12     
  Misses       3890     3890              
  Partials      304      304              
Files Coverage Δ
internal/dag/gatewayapi_processor.go 93.74% <100.00%> (+<0.01%) ⬆️
internal/gatewayapi/listeners.go 100.00% <100.00%> (ø)

@izturn izturn requested review from skriss and sunjayBhatia and removed request for stevesloka November 14, 2023 10:06
Signed-off-by: gang.liu <gang.liu@daocloud.io>
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.

just a requested change on the release note so far but from a quick look at the test changes/code changes this looks like it achieves what looks like the right outcome for the most part, though ends up being a little repetitive

With this change, we're processing Listeners/Routes multiple times now, once looping through the Listeners for finding which ones are valid, then going through each Listener/Route another time for seeing if the Routes can attach/intersect hostnames, then doing the Listener/Route analysis again for the purposes of calculating attached route counts. It would be good to coalesce some of this logic together since it seems like extra processing we could reduce.

Maybe this looks like not returning early from computeListener and including the error of why the listener is invalid/if it should still be allowed to have attached routes in the returned listenerInfo struct

This isn't something the upstream conformance tests are checking yet, but if this doesn't exist would be good to ensure a test exists for a Gateway Listener that has an invalid configuration in its route selection (e.g. invalid namespace selector due to a field missing or invalid route kind) but a Route with a parent ref that would be valid should still not count

changelogs/unreleased/5961-izturn-small.md Outdated Show resolved Hide resolved
internal/dag/status.go Outdated Show resolved Hide resolved
Signed-off-by: gang.liu <gang.liu@daocloud.io>
Signed-off-by: gang.liu <gang.liu@daocloud.io>
Signed-off-by: gang.liu <gang.liu@daocloud.io>
Signed-off-by: gang.liu <gang.liu@daocloud.io>
@izturn izturn requested a review from sunjayBhatia November 20, 2023 13:25
@izturn
Copy link
Member Author

izturn commented Nov 27, 2023

ping @sunjayBhatia

internal/dag/gatewayapi_processor.go Outdated Show resolved Hide resolved
internal/dag/gatewayapi_processor.go Show resolved Hide resolved
internal/dag/status_test.go Outdated Show resolved Hide resolved
Signed-off-by: gang.liu <gang.liu@daocloud.io>
Signed-off-by: gang.liu <gang.liu@daocloud.io>
@izturn izturn requested a review from sunjayBhatia December 11, 2023 02:57
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

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

Couple nits but otherwise looks pretty good to me (I'm heavily relying on the tests here for correctness!)

internal/dag/gatewayapi_processor.go Outdated Show resolved Hide resolved
internal/dag/gatewayapi_processor.go Outdated Show resolved Hide resolved
Signed-off-by: gang.liu <gang.liu@daocloud.io>
@izturn izturn requested a review from skriss December 12, 2023 01:58
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

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

LGTM, will leave for @sunjayBhatia

@sunjayBhatia sunjayBhatia merged commit ec46fff into projectcontour:main Dec 12, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gateway-api Issues or PRs related to the Gateway (Gateway API working group) API. release-note/small A small change that needs one line of explanation in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gateway API: fix for failing GatewayWithAttachedRoutes conformance test
3 participants