Skip to content

Add support for redirect filters#249

Merged
arkodg merged 5 commits intoenvoyproxy:mainfrom
Alice-Lilith:alicewasko/dev/support-redirects
Sep 7, 2022
Merged

Add support for redirect filters#249
arkodg merged 5 commits intoenvoyproxy:mainfrom
Alice-Lilith:alicewasko/dev/support-redirects

Conversation

@Alice-Lilith
Copy link
Copy Markdown
Member

@Alice-Lilith Alice-Lilith commented Aug 25, 2022

Adds support for gateway API Redirect Filters.
This is my first PR to the repo so feedback is greatly appreciated .

Fixes: #159

@Alice-Lilith Alice-Lilith requested a review from a team as a code owner August 25, 2022 21:23
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 25, 2022

Codecov Report

Merging #249 (8b52e35) into main (a958828) will increase coverage by 1.22%.
The diff coverage is 63.66%.

@@            Coverage Diff             @@
##             main     #249      +/-   ##
==========================================
+ Coverage   58.12%   59.34%   +1.22%     
==========================================
  Files          31       32       +1     
  Lines        2832     3215     +383     
==========================================
+ Hits         1646     1908     +262     
- Misses       1087     1199     +112     
- Partials       99      108       +9     
Impacted Files Coverage Δ
internal/ir/zz_generated.deepcopy.go 0.00% <0.00%> (ø)
internal/gatewayapi/translator.go 84.36% <79.54%> (-1.08%) ⬇️
internal/xds/translator/route.go 46.37% <90.19%> (+22.20%) ⬆️
internal/ir/xds.go 83.08% <100.00%> (+7.04%) ⬆️
internal/infrastructure/kubernetes/infra.go 52.23% <0.00%> (-6.10%) ⬇️
internal/gatewayapi/contexts.go 76.77% <0.00%> (-1.52%) ⬇️
internal/provider/kubernetes/gatewayclass.go 67.54% <0.00%> (-1.37%) ⬇️
internal/utils/env/env.go 100.00% <0.00%> (ø)
internal/infrastructure/kubernetes/deployment.go 83.24% <0.00%> (+1.07%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Alice-Lilith Alice-Lilith changed the title [WIP] Add support for redirect filters Add support for redirect filters Aug 26, 2022
@danehans
Copy link
Copy Markdown
Contributor

@AliceProxy please rebase when you have a moment.

@danehans danehans added the area/translator Issues related to Gateway's translation service, e.g. translating Gateway APIs into the IR. label Aug 30, 2022
@danehans danehans added this to the 0.2.0-rc2 milestone Aug 30, 2022
@skriss skriss self-requested a review August 30, 2022 22:11
@Alice-Lilith
Copy link
Copy Markdown
Member Author

Sorry about the recent pushes. I thought I was done with this but realized there were some problems that I needed to fix and I added some better test coverage.

@danehans
Copy link
Copy Markdown
Contributor

@skriss do you mind reviewing since you have a good understanding of this code?

@danehans
Copy link
Copy Markdown
Contributor

danehans commented Sep 1, 2022

@AliceProxy can you investigate the CI failure?

@skriss
Copy link
Copy Markdown
Contributor

skriss commented Sep 1, 2022

Yep it's on my list to review, just need to find some time!

@Alice-Lilith
Copy link
Copy Markdown
Member Author

@AliceProxy can you investigate the CI failure?

@danehans The most recent commit should resolve the CI failure.

Copy link
Copy Markdown
Contributor

@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.

Thanks @AliceProxy, overall this looks great! Had a few initial comments, still looking through the test cases.

@skriss
Copy link
Copy Markdown
Contributor

skriss commented Sep 6, 2022

One other note, just for future reference - our initial goal for EG is to meet "core" Gateway API conformance. As such, I think it'd be fine to start by only implementing the parts of these filters that are required for core conformance, and save "extended" features for later (that's the approach that's been taken with most of the existing Gateway API code). It might help keep the PRs a bit smaller.

Comment on lines 649 to 650
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We're ending up with a lot of silly code that looks like this. Perhaps we should add a utility function

func ptrTo[T any](x T) *T {
    return &x
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Very true, but I kind of feel like this should be a separate PR after this just to keep the logical size smaller.

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Sep 6, 2022

@AliceProxy thanks for adding the tests in the IR and xDS libs ! LGTM from my end wrt code in those libs, hoping others can review the gatewayapi/translator diffs

Copy link
Copy Markdown
Contributor

@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 other reviewers to merge when ready.

Comment on lines +84 to +85
# I believe the correct way to handle an invalid filter should be to allow the HTTPRoute to function
# normally but leave out the filter config and set the status, but this behaviour can be changed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I think the expected behavior here is unclear in the Gateway API spec -- we can drive some clarity upstream, but doesn't need to block this PR now.

@Alice-Lilith Alice-Lilith requested review from LukeShu and arkodg and removed request for LukeShu and arkodg September 7, 2022 20:56
@arkodg arkodg merged commit b0920a6 into envoyproxy:main Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/translator Issues related to Gateway's translation service, e.g. translating Gateway APIs into the IR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add support for request redirect filter

6 participants