Skip to content

Commit

Permalink
multiple fixes to HTTPRequestRedirect filter
Browse files Browse the repository at this point in the history
- Add `Filter` prefix to the struct to match other filters
- Rename `Protocol` to `Scheme`
  • Loading branch information
hbagdi committed Sep 15, 2021
1 parent d540dee commit acf6e12
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
16 changes: 8 additions & 8 deletions apis/v1alpha2/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
// Support: Core
//
// +optional
// +kubebuilder:validation:Enum=HTTP;HTTPS
Protocol *string `json:"protocol,omitempty"`
// +kubebuilder:validation:Enum=http;https
Scheme *string `json:"scheme,omitempty"`

// Hostname is the hostname to be used in the value of the `Location`
// header in the response.
Expand Down
14 changes: 7 additions & 7 deletions apis/v1alpha2/zz_generated.deepcopy.go

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

28 changes: 14 additions & 14 deletions config/crd/v1alpha2/gateway.networking.k8s.io_httproutes.yaml

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

2 changes: 1 addition & 1 deletion examples/v1alpha2/http-redirect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- filters:
- type: RequestRedirect
requestRedirect:
protocol: HTTPS
scheme: https
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: HTTPRoute
Expand Down

0 comments on commit acf6e12

Please sign in to comment.