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

Clarifying Redirect Support levels #723

Merged
merged 1 commit into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apis/v1alpha2/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,23 +657,31 @@ type HTTPRequestRedirect struct {
// header in the response.
// When empty, the protocol of the request is used.
//
// Support: Extended
Copy link
Member Author

Choose a reason for hiding this comment

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

For GCP we have some cases where we just support same protocol or HTTP->HTTPS, not HTTPS->HTTP. I think that means this field should be extended.

//
// +optional
// +kubebuilder:validation:Enum=HTTP;HTTPS
Protocol *string `json:"protocol,omitempty"`
// Hostname is the hostname to be used in the value of the `Location`
// header in the response.
// When empty, the hostname of the request is used.
//
// Support: Core
//
// +optional
Hostname *string `json:"hostname,omitempty"`
// Port is the port to be used in the value of the `Location`
// header in the response.
// When empty, port (if specified) of the request is used.
//
// Support: Extended
Copy link
Member Author

Choose a reason for hiding this comment

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

Redirecting to arbitrary ports is not supported as broadly as I'd hoped.

//
// +optional
Port *int `json:"port,omitempty"`
// StatusCode is the HTTP status code to be used in response.
//
// Support: Core
//
// +optional
// +kubebuilder:default=302
// +kubebuilder:validation=301;302
Expand Down
35 changes: 19 additions & 16 deletions config/crd/bases/gateway.networking.k8s.io_httproutes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions site-src/v1alpha2/concepts/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ universal support will not be a blocker towards developing portable
feature sets. Standardizing on spec will make it easier to eventually
graduate to CORE when support is widespread.

### Overlapping Support Levels
It is possible for support levels to overlap. When this occurs, the minimum
expressed support level should be interpreted. For example, an identical struct
may be embedded in two different places. In one of those places, the struct is
considered to have CORE support while the other place only includes EXTENDED
support. Fields within this struct may express separate CORE and EXTENDED
support levels, but those levels may never be interpreted as exceeding the
support level of the parent struct they are embedded in.

For a more concrete example, HTTPRoute includes CORE support for filters defined
within a Rule and EXTENDED support when defined within ForwardTo. Those filters
may separately define support levels for each field. When interpreting
overlapping support levels, the minimum value should be interpreted. That means
if a field has a CORE support level but is in a filter attached in a place with
EXTENDED support, the interpreted support level should be EXTENDED.

### Conformance expectations

We expect there will be varying levels of conformance among the
Expand Down