-
Notifications
You must be signed in to change notification settings - Fork 632
Add 307 / 308 Redirect Status Code Support #3823
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
Add 307 / 308 Redirect Status Code Support #3823
Conversation
|
Welcome @davidwin93! |
|
Hi @davidwin93. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
40c5a81 to
febeeba
Compare
|
Thanks @davidwin93, this will be a great improvement! /ok-to-test |
22fe26d to
b5bf3dc
Compare
|
/cc |
Is there any suggestion that we would want to include in docs for this behavior for 301 and 302 responses? |
|
I'd like to see the user-facing docs updated as part of this PR -- thanks!! |
LiorLieberman
left a comment
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.
echoing feedback from today's community meeting.
this may benefit from a SupportedFeature for gradual enablement, because if this gets in, if there is any implementation that does not support 307 and 308 they go out of conformance
|
@LiorLieberman in regards to SupportedFeature do I need to wait for this to get in first? |
Can we add this as Extended (optional)? |
no, these are two different things. when I said supported features I really meant a FeatureName - like https://github.com/kubernetes-sigs/gateway-api/blob/main/conformance/tests/httproute-response-header-modifier.go#L40 for example. And @candita, to your point, adding a featureName would mean it is initially extended, but as said during the meeting, we should communicate clearly we are only doing it for gradual enablement, with intentions to move it to core (and remove the featureName) once we communicated it enough |
eb81b90 to
47ccbaf
Compare
|
@LiorLieberman this should be good for another pass. I believe I've addressed the comments correctly. |
| // This option indicates support for HTTPRoute additional redirect status code 303 (extended conformance) | ||
| SupportHTTPRoute303RedirectStatusCode FeatureName = "HTTPRoute303RedirectStatusCode" | ||
|
|
||
| // This option indicates support for HTTPRoute additional redirect status code 303 (extended conformance) |
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.
please fix the comment of this and next feature (they are all still with code 303)
|
do we have some implementation already supporting these return codes, just so we can do a run and guarantee that conformance is also ok? Thanks! |
|
Thanks everyone for the work and discussion on this. I completely understand why this has taken some time to make it in, and also why it didn't make the most recent release. These things happen, and the process around release management and validation criteria is important to keep stable. That said, I do want to highlight a concern from the perspective of downstream adopters and integrators. When changes like this can't make it into a patch or minor release—even when they're relatively small, such as expanding an enum or adding a bit of CEL validation—it effectively means that these improvements can take close to a year to reach users, given the six-month release cadence. That long gap can make it difficult for projects building on Gateway API to support their users or align on conformance, especially when a missing option or validation rule blocks certain use cases. Over time, this can lead to the same challenges that the Ingress API experienced, where implementations resorted to annotations or custom extensions to fill gaps that the upstream API couldn't evolve quickly enough to cover. You can see in the reference above where we have moved to do exactly that in kgateway due to this not merging and that given prior discussion here our understanding is that changes like this can only go in minor versions. For those reasons, I'd like to suggest we re-evaluate how we classify and handle changes like this. It seems like there should be a safe path for small, backward-compatible improvements to land in patch releases, especially when they improve expressiveness or correctness without changing behavior or compliance. Really appreciate everyone's continued work here; I just want to make sure Gateway API can keep evolving fast enough to stay broadly usable across the ecosystem. |
|
This is part of the point of the changes discussed in #4164 -- the idea is that yes, it should be faster to get things into an experimental-channel release that people can experiment with. |
|
Thanks @kflynn! A very timely discussion, from a skim I think moving to a model of monthly releases for the experimental channel makes a lot of sense. To make sure I understand correctly, in the context of this PR where there is an agreed upon change that should be made to the stable & experimental versions simultaneously, it just means that the changes would be available at most within a month of merging via the experimental channel? Then they will be in the next stable release whenever that happens? |
You're completely right, this took too long to get in. Improving this is a big focus for us, a big thanks to @kflynn for helping move this forward. |
|
There was some concern if this was too late to squeeze in before v1.4, but now that that release is out, I think it's past time to get this change in. |
robscott
left a comment
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.
Thanks @davidwin93!
/lgtm
/approve
| } | ||
|
|
||
| var MeshHTTPRoute303Redirect = suite.ConformanceTest{ | ||
| ShortName: "MeshHTTPRoute303Redirect", |
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.
@davidwin93 Do you mind filing a follow up issue to migrate these tests to reuse more code?
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidwin93, robscott The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
I agree that this is a fine candidate for the next release! @davidwin93, one major upcoming change is that you need to line up some implementations who're willing to implement this as an experimental feature, although we, uh, haven't decided exactly how to record that. A comment here will do for now. 🙂 |
|
Istio and kgateway implement this experimental feature now. |
* add support for 303 status and split 307/308 into seperate features * add tests for 303 redirect * split 307 and 308 redirect features * update documentation to cover 303,307,308 status codes * add redirect status codes to httproute crd enum * update conformance tests to focus only on status code validation
What type of PR is this?
/kind bug
/area conformance-test
What this PR does / why we need it:
This PR allows users to select either a 303, 307 or 308 status code along with the existing options of 301 and 302. This matches RFC 9110 and by letting users select 308 it will match the existing nginx ingress behaviour of using a 308 for HTTP -> HTTPS redirects.
Which issue(s) this PR fixes:
Fixes #2748
Does this PR introduce a user-facing change?:
This will allow users to select 303,307 or 308 as redirect status codes along with 301 and 302.