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

Implement Exact HTTPHeaderMatch #3538

Merged
merged 1 commit into from
Apr 8, 2021
Merged

Implement Exact HTTPHeaderMatch #3538

merged 1 commit into from
Apr 8, 2021

Conversation

nak3
Copy link
Member

@nak3 nak3 commented Apr 3, 2021

This patch adds Exact HTTPHeaderMatch support.

Fixes #3356

Signed-off-by: Kenjiro Nakayama nakayamakenjiro@gmail.com

/cc @stevesloka @youngnick @sunjayBhatia

@nak3 nak3 requested a review from a team as a code owner April 3, 2021 12:08
@nak3 nak3 requested review from stevesloka and skriss and removed request for a team April 3, 2021 12:08
@codecov
Copy link

codecov bot commented Apr 3, 2021

Codecov Report

Merging #3538 (170db70) into main (298d3d2) will increase coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head 170db70 differs from pull request most recent head 4b6e734. Consider uploading reports for the commit 4b6e734 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3538      +/-   ##
==========================================
+ Coverage   76.23%   76.27%   +0.03%     
==========================================
  Files         100      100              
  Lines        6892     6903      +11     
==========================================
+ Hits         5254     5265      +11     
  Misses       1521     1521              
  Partials      117      117              
Impacted Files Coverage Δ
internal/status/httproutestatus.go 34.54% <ø> (ø)
internal/dag/gatewayapi_processor.go 84.55% <100.00%> (+1.51%) ⬆️

internal/dag/builder_test.go Show resolved Hide resolved
internal/dag/builder_test.go Outdated Show resolved Hide resolved
var services []*Service

for _, match := range rule.Matches {
mc := &matchConditions{}
switch match.Path.Type {
Copy link
Member

Choose a reason for hiding this comment

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

probably need a nil check on the Path field as well, since it can be omitted

probably should add a test that adds a header match but no path match (which should result in a default / prefix match) to ensure this is covered

Copy link
Member Author

Choose a reason for hiding this comment

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

Added match.Path.Value == "" || match.Path.Type == "" check since match.Path was changed to pointer recently by kubernetes-sigs/gateway-api@9d63656 (not included in current gateway-api release) so we need to change it to nilt check when gateway-api lib is updated.

internal/dag/gatewayapi_processor.go Outdated Show resolved Hide resolved
This patch adds Exact HTTPHeaderMatch.

Signed-off-by: Kenjiro Nakayama <nakayamakenjiro@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement "Exact" HTTPHeaderMatch
4 participants