diff --git a/apis/v1alpha2/httproute_types.go b/apis/v1alpha2/httproute_types.go index 660b22ac8d..2bf8f6bef1 100644 --- a/apis/v1alpha2/httproute_types.go +++ b/apis/v1alpha2/httproute_types.go @@ -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,24 +646,20 @@ 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. - // - // Support: Extended + // When empty, the scheme of the request is used. // // +optional // +kubebuilder:validation:Enum=HTTP;HTTPS - Protocol *string `json:"protocol,omitempty"` + Scheme *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 *Hostname `json:"hostname,omitempty"` @@ -671,15 +667,11 @@ type HTTPRequestRedirect struct { // header in the response. // When empty, port (if specified) of the request is used. // - // Support: Extended - // // +optional Port *PortNumber `json:"port,omitempty"` // StatusCode is the HTTP status code to be used in response. // - // Support: Core - // // +optional // +kubebuilder:default=302 // +kubebuilder:validation:Enum=301;302 diff --git a/apis/v1alpha2/zz_generated.deepcopy.go b/apis/v1alpha2/zz_generated.deepcopy.go index 79a2b36dfc..06bc374a6b 100644 --- a/apis/v1alpha2/zz_generated.deepcopy.go +++ b/apis/v1alpha2/zz_generated.deepcopy.go @@ -563,10 +563,10 @@ func (in *HTTPRequestMirrorFilter) DeepCopy() *HTTPRequestMirrorFilter { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HTTPRequestRedirect) DeepCopyInto(out *HTTPRequestRedirect) { +func (in *HTTPRequestRedirectFilter) DeepCopyInto(out *HTTPRequestRedirectFilter) { *out = *in - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme *out = new(string) **out = **in } @@ -587,12 +587,12 @@ func (in *HTTPRequestRedirect) DeepCopyInto(out *HTTPRequestRedirect) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRequestRedirect. -func (in *HTTPRequestRedirect) DeepCopy() *HTTPRequestRedirect { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRequestRedirectFilter. +func (in *HTTPRequestRedirectFilter) DeepCopy() *HTTPRequestRedirectFilter { if in == nil { return nil } - out := new(HTTPRequestRedirect) + out := new(HTTPRequestRedirectFilter) in.DeepCopyInto(out) return out } @@ -639,7 +639,7 @@ func (in *HTTPRouteFilter) DeepCopyInto(out *HTTPRouteFilter) { } if in.RequestRedirect != nil { in, out := &in.RequestRedirect, &out.RequestRedirect - *out = new(HTTPRequestRedirect) + *out = new(HTTPRequestRedirectFilter) (*in).DeepCopyInto(*out) } if in.ExtensionRef != nil { diff --git a/config/crd/v1alpha2/gateway.networking.k8s.io_httproutes.yaml b/config/crd/v1alpha2/gateway.networking.k8s.io_httproutes.yaml index e674e0f052..a917625e82 100644 --- a/config/crd/v1alpha2/gateway.networking.k8s.io_httproutes.yaml +++ b/config/crd/v1alpha2/gateway.networking.k8s.io_httproutes.yaml @@ -450,36 +450,36 @@ spec: HTTP redirection. \n Support: Core" properties: hostname: - description: "Hostname is the hostname to be + description: 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. \n Support: Core" + of the request is used. maxLength: 253 minLength: 1 pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string port: - description: "Port is the port to be used in + description: 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. \n Support: Extended" + of the request is used. format: int32 maximum: 65535 minimum: 1 type: integer protocol: - description: "Protocol is the protocol to be - used in the value of the `Location` header - in the response. When empty, the protocol - of the request is used. \n Support: Extended" + description: Scheme is the scheme to be used + in the value of the `Location` header in the + response. When empty, the scheme of the request + is used. enum: - HTTP - HTTPS type: string statusCode: default: 302 - description: "StatusCode is the HTTP status - code to be used in response. \n Support: Core" + description: StatusCode is the HTTP status code + to be used in response. enum: - 301 - 302 @@ -823,36 +823,33 @@ spec: \n Support: Core" properties: hostname: - description: "Hostname is the hostname to be used - in the value of the `Location` header in the response. + description: 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. - \n Support: Core" maxLength: 253 minLength: 1 pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string port: - description: "Port is the port to be used in the value + description: 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. \n Support: - Extended" + port (if specified) of the request is used. format: int32 maximum: 65535 minimum: 1 type: integer protocol: - description: "Protocol is the protocol to be used - in the value of the `Location` header in the response. - When empty, the protocol of the request is used. - \n Support: Extended" + description: Scheme is the scheme to be used in the + value of the `Location` header in the response. + When empty, the scheme of the request is used. enum: - HTTP - HTTPS type: string statusCode: default: 302 - description: "StatusCode is the HTTP status code to - be used in response. \n Support: Core" + description: StatusCode is the HTTP status code to + be used in response. enum: - 301 - 302 diff --git a/examples/v1alpha2/http-redirect.yaml b/examples/v1alpha2/http-redirect.yaml index d12e90f8a6..5ae397ab51 100644 --- a/examples/v1alpha2/http-redirect.yaml +++ b/examples/v1alpha2/http-redirect.yaml @@ -44,7 +44,7 @@ spec: - filters: - type: RequestRedirect requestRedirect: - protocol: HTTPS + scheme: HTTPS --- apiVersion: gateway.networking.k8s.io/v1alpha2 kind: HTTPRoute