-
Notifications
You must be signed in to change notification settings - Fork 665
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
internal: bump gatewayapi dep to latest #3603
Conversation
I tried to keep things into separate commits to make review easier, but the pointers, oh my. =) |
Codecov Report
@@ Coverage Diff @@
## main #3603 +/- ##
==========================================
- Coverage 76.73% 76.72% -0.02%
==========================================
Files 100 100
Lines 7097 7124 +27
==========================================
+ Hits 5446 5466 +20
- Misses 1534 1538 +4
- Partials 117 120 +3
|
We can merge #3581 first no problem. Let me go build out a 1.21 kind image to test with in the meantime until an official image is out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great, and really illustrates why it's better to do this now, rather than later.
needs a rebase now |
I ended up squashing my original commits since I had to keep doing the entire rebase again. 😢 |
internal/dag/gatewayapi_processor.go
Outdated
// https://github.com/kubernetes-sigs/gateway-api/commit/9d63656df8cc9e67da60d4fe3f6289aad22e72d3 | ||
if match.Path.Value == "" || match.Path.Type == "" { | ||
match.Path = gatewayapi_v1alpha1.HTTPPathMatch{Type: gatewayapi_v1alpha1.PathMatchPrefix, Value: "/"} | ||
if match.Path == nil && match.Headers == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice short circuit, +1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we have tests already for this case
internal/dag/gatewayapi_processor.go
Outdated
match.Path = gatewayapi_v1alpha1.HTTPPathMatch{Type: gatewayapi_v1alpha1.PathMatchPrefix, Value: "/"} | ||
if match.Path == nil && match.Headers == nil { | ||
// No match conditions are defined, so default to 'PrefixMatch' with a value of '/'. | ||
match.Path = &gatewayapi_v1alpha1.HTTPPathMatch{Type: pathMatchTypePtr(gatewayapi_v1alpha1.PathMatchPrefix), Value: pointer.StringPtr("/")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this modify mc
insteadof match
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can actually remove this whole bit since now we're checking for nil in the other helper bits.
internal/dag/gatewayapi_processor.go
Outdated
} else { | ||
switch *match.Type { | ||
case gatewayapi_v1alpha1.PathMatchPrefix: | ||
mc.pathMatchConditions = append(mc.pathMatchConditions, &PrefixMatchCondition{Prefix: pointer.StringDeref(match.Value, "/")}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could pull out the pointer.StringDeref(match.Value, "/")
above so it is only done once
return nil | ||
} | ||
|
||
if match.Type != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is being defaulted to Exact: https://github.com/kubernetes-sigs/gateway-api/blob/cbbdc4c1ba2b0468f5412477c0de2f02d4089abf/apis/v1alpha1/httproute_types.go#L315
👍🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, I updated. We're finding some good bugs in this PR. =)
Signed-off-by: Steve Sloka <slokas@vmware.com>
Signed-off-by: Steve Sloka <slokas@vmware.com>
Signed-off-by: Steve Sloka <slokas@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, all the pointer stuff is definitely annoying but 🤷♂️
Thanks for all the reviews @skriss @sunjayBhatia @youngnick! 🎉 I'll merge this now and refresh once the GatewayAPI release is out. |
Updates the gateway-api dep to "latest" to keep on pace with breaking changes in the upcoming v0.3.0 release.
Fixes #3578
Signed-off-by: Steve Sloka slokas@vmware.com