-
Notifications
You must be signed in to change notification settings - Fork 328
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
Updates ParentRef Status Conditions #495
Conversation
@skriss with this PR an |
Agree, I'd expect an |
...nal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml
Show resolved
Hide resolved
internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml
Show resolved
Hide resolved
.../gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml
Show resolved
Hide resolved
internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml
Show resolved
Hide resolved
internal/gatewayapi/translator.go
Outdated
parentRef.SetCondition( | ||
v1beta1.RouteConditionResolvedRefs, | ||
metav1.ConditionFalse, | ||
v1beta1.RouteConditionAccepted, | ||
metav1.ConditionTrue, | ||
v1beta1.RouteReasonUnsupportedValue, | ||
fmt.Sprintf("RequestHeaderModifier Filter already configures request header: %s to be added, ignoring second entry", headerKey), | ||
) |
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.
From my read of the spec, we should either be ignoring the duplicate header, or appending its value:
- https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPHeaderFilter
- https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPHeader
But it doesn't seem like we need to be setting a condition here.
Regardless, the combo of Accepted: true
with reason UnsupportedValue
does not seem valid -- if we're using the UnsupportedValue
reason, then the status should be False
.
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.
/cc @AliceProxy
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.
From my read of the spec, we should either be ignoring the duplicate header, or appending its value:
The code currently ignores duplicate headers from the add/remove operations. Commit e3210aa no longer sets a status condition for these cases and therefore an Accepted=true
condition is surfaced.
Signed-off-by: danehans <daneyonhansen@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #495 +/- ##
==========================================
+ Coverage 60.21% 60.24% +0.03%
==========================================
Files 45 45
Lines 5582 5564 -18
==========================================
- Hits 3361 3352 -9
+ Misses 2011 2003 -8
+ Partials 210 209 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: danehans <daneyonhansen@gmail.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.
Looks reasonable to me, and we'll likely revisit some of this with upcoming Gateway API spec changes around conditions.
* Updates ParentRef Status Conditions Signed-off-by: danehans <daneyonhansen@gmail.com> * Resolved @skriss 10-11-22 Feedback Signed-off-by: danehans <daneyonhansen@gmail.com> Signed-off-by: danehans <daneyonhansen@gmail.com>
Updates the
Accepted
condition type to use RouteReasonUnsupportedValue instead of theResolvedRefs
condition type.Fixes #494
Signed-off-by: danehans daneyonhansen@gmail.com