diff --git a/apis/v1alpha2/httproute_types.go b/apis/v1alpha2/httproute_types.go index 660b22ac8d..064f399502 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,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. 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..205cc4a86c 100644 --- a/config/crd/v1alpha2/gateway.networking.k8s.io_httproutes.yaml +++ b/config/crd/v1alpha2/gateway.networking.k8s.io_httproutes.yaml @@ -467,14 +467,14 @@ spec: 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" + scheme: + 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. \n Support: Core" enum: - - HTTP - - HTTPS + - http + - https type: string statusCode: default: 302 @@ -840,14 +840,14 @@ spec: 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" + scheme: + 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. \n + Support: Core" enum: - - HTTP - - HTTPS + - http + - https type: string statusCode: default: 302 diff --git a/examples/v1alpha2/http-redirect.yaml b/examples/v1alpha2/http-redirect.yaml index d12e90f8a6..702cbb1c2a 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