-
Notifications
You must be signed in to change notification settings - Fork 498
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
multiple fixes to HTTPRequestRedirect filter #863
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -506,7 +506,7 @@ type HTTPRouteFilter struct { | |
// Support: Core | ||
// | ||
// +optional | ||
RequestRedirect *HTTPRequestRedirect `json:"requestRedirect,omitempty"` | ||
RequestRedirect *HTTPRequestRedirectFilter `json:"requestRedirect,omitempty"` | ||
|
||
// ExtensionRef is an optional, implementation-specific extension to the | ||
// "filter" behavior. For example, resource "myroutefilter" in group | ||
|
@@ -646,17 +646,17 @@ type HTTPRequestHeaderFilter struct { | |
Remove []string `json:"remove,omitempty"` | ||
} | ||
|
||
// HTTPRequestRedirect defines configuration for the RequestRedirect filter. | ||
type HTTPRequestRedirect struct { | ||
// Protocol is the protocol to be used in the value of the `Location` | ||
// HTTPRequestRedirectFilter defines configuration for the RequestRedirect filter. | ||
type HTTPRequestRedirectFilter struct { | ||
// Scheme is the scheme to be used in the value of the `Location` | ||
// header in the response. | ||
// When empty, the protocol of the request is used. | ||
// When empty, the scheme of the request is used. | ||
// | ||
// Support: Extended | ||
// | ||
// +optional | ||
// +kubebuilder:validation:Enum=HTTP;HTTPS | ||
Protocol *string `json:"protocol,omitempty"` | ||
// +kubebuilder:validation:Enum=http;https | ||
Scheme *string `json:"scheme,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While the protocol was "HTTP", I guess the scheme should be "http"? |
||
|
||
// Hostname is the hostname to be used in the value of the `Location` | ||
// header in the response. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 don't think we can remove the support levels here. I can't find/remember where this was documented, but I thought we agreed that support level was essentially a min of field and parent support level. This was particularly important for filters since they could be defined per Route Rule or per Backend. In this case, we'd be removing an "Extended" support annotation and deferring to the "Core" support of redirects in general which does not seem accurate here. This comment applies throughout, but just adding it here.
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.
As a follow up, this PR recovers the docs that got lost around this: #864.
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 expected some discussion on this front.
I'm a bit confused here so making sure I understand you right.
I think we agree with this statement. I removed the Extended support level because the filter is marked as "Core". Marking the filter as "Extended" is another option to adhere to this rule.
Or are you saying that we should keep the filter as "Core" and have some fields marked as "Extended" (leave as is)?
The concern I've with this approach is that as a user, I might get surprised when I'm using a Core filter with a conformant implementation but something doesn't work and the reason is a field-level documentation that I didn't peruse.
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.
Although I agree this could get confusing, I think the alternatives are worse. The way I see it we have two options:
The current PR actually is more of a third option - it removes the "Extended" annotation on several fields, which may lead users to believe the field had "Core" support. Unfortunately there's at least one implementation that can't support the field, so that seems inaccurate.
Of the options I listed above, I strongly prefer 1 because otherwise I think we'd end up avoiding new fields or with a lot of "Extended" features.
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.
An alternative is to have a filter "RequestRedirectExtended" (with a better name) in addition to the core filter. That lays out the contract much more explicitly and makes the end-user experience free of confusion.
We can't take this approach with more involved features within the guts of the API, but with filters, we can.
Having said that, I've reverted the changes related to conformance levels to minimize the scope of the PR.