diff --git a/apis/v1beta1/httproute_types.go b/apis/v1beta1/httproute_types.go index f35e3486d5..1a17d1846a 100644 --- a/apis/v1beta1/httproute_types.go +++ b/apis/v1beta1/httproute_types.go @@ -583,7 +583,7 @@ type HTTPRouteFilter struct { // Reason of `UnsupportedValue`. // // +unionDiscriminator - // +kubebuilder:validation:Enum=RequestHeaderModifier;RequestMirror;RequestRedirect;ExtensionRef + // +kubebuilder:validation:Enum=RequestHeaderModifier;RequestMirror;RequestRedirect;URLRewrite;ExtensionRef // Type HTTPRouteFilterType `json:"type"` @@ -625,7 +625,6 @@ type HTTPRouteFilter struct { // // Support: Extended // - // // +optional URLRewrite *HTTPURLRewriteFilter `json:"urlRewrite,omitempty"` @@ -658,6 +657,7 @@ const ( // Support in HTTPRouteRule: Extended // // Support in HTTPBackendRef: Extended + // // HTTPRouteFilterResponseHeaderModifier HTTPRouteFilterType = "ResponseHeaderModifier" @@ -679,8 +679,6 @@ const ( // Support in HTTPRouteRule: Extended // // Support in HTTPBackendRef: Extended - // - // HTTPRouteFilterURLRewrite HTTPRouteFilterType = "URLRewrite" // HTTPRouteFilterRequestMirror can be used to mirror HTTP requests to a @@ -817,7 +815,6 @@ const ( ) // HTTPPathModifier defines configuration for path modifiers. -// type HTTPPathModifier struct { // Type defines the type of path modifier. Additional types may be // added in a future release of the API. @@ -829,14 +826,12 @@ type HTTPPathModifier struct { // Accepted Condition for the Route to `status: False`, with a // Reason of `UnsupportedValue`. // - // // +kubebuilder:validation:Enum=ReplaceFullPath;ReplacePrefixMatch Type HTTPPathModifierType `json:"type"` // ReplaceFullPath specifies the value with which to replace the full path // of a request during a rewrite or redirect. // - // // +kubebuilder:validation:MaxLength=1024 // +optional ReplaceFullPath *string `json:"replaceFullPath,omitempty"` @@ -851,7 +846,6 @@ type HTTPPathModifier struct { // ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all // match the prefix `/abc`, but the path `/abcd` would not. // - // // +kubebuilder:validation:MaxLength=1024 // +optional ReplacePrefixMatch *string `json:"replacePrefixMatch,omitempty"` @@ -892,7 +886,6 @@ type HTTPRequestRedirectFilter struct { // // Support: Extended // - // // +optional Path *HTTPPathModifier `json:"path,omitempty"` @@ -935,15 +928,12 @@ type HTTPRequestRedirectFilter struct { // MUST NOT be used on the same Route rule as a HTTPRequestRedirect filter. // // Support: Extended -// -// type HTTPURLRewriteFilter struct { // Hostname is the value to be used to replace the Host header value during // forwarding. // // Support: Extended // - // // +optional Hostname *PreciseHostname `json:"hostname,omitempty"` @@ -951,7 +941,6 @@ type HTTPURLRewriteFilter struct { // // Support: Extended // - // // +optional Path *HTTPPathModifier `json:"path,omitempty"` } diff --git a/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml b/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml index 03370f2ab3..b3cec0d3a0 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml @@ -533,14 +533,12 @@ spec: modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request - path is used as-is. \n Support: Extended \n - " + path is used as-is. \n Support: Extended" properties: replaceFullPath: - description: "ReplaceFullPath specifies - the value with which to replace the full - path of a request during a rewrite or - redirect. \n " + description: ReplaceFullPath specifies the + value with which to replace the full path + of a request during a rewrite or redirect. maxLength: 1024 type: string replacePrefixMatch: @@ -557,8 +555,7 @@ spec: When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix - `/abc`, but the path `/abcd` would not. - \n " + `/abc`, but the path `/abcd` would not." maxLength: 1024 type: string type: @@ -571,7 +568,7 @@ spec: values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason - of `UnsupportedValue`. \n " + of `UnsupportedValue`." enum: - ReplaceFullPath - ReplacePrefixMatch @@ -778,25 +775,24 @@ spec: urlRewrite: description: "URLRewrite defines a schema for a filter that modifies a request during forwarding. - \n Support: Extended \n " + \n Support: Extended" properties: hostname: description: "Hostname is the value to be used to replace the Host header value during forwarding. - \n Support: Extended \n " + \n Support: Extended" 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 path: description: "Path defines a path rewrite. \n - Support: Extended \n " + Support: Extended" properties: replaceFullPath: - description: "ReplaceFullPath specifies - the value with which to replace the full - path of a request during a rewrite or - redirect. \n " + description: ReplaceFullPath specifies the + value with which to replace the full path + of a request during a rewrite or redirect. maxLength: 1024 type: string replacePrefixMatch: @@ -813,8 +809,7 @@ spec: When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix - `/abc`, but the path `/abcd` would not. - \n " + `/abc`, but the path `/abcd` would not." maxLength: 1024 type: string type: @@ -827,7 +822,7 @@ spec: values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason - of `UnsupportedValue`. \n " + of `UnsupportedValue`." enum: - ReplaceFullPath - ReplacePrefixMatch @@ -1184,12 +1179,12 @@ spec: the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is. \n Support: - Extended \n " + Extended" properties: replaceFullPath: - description: "ReplaceFullPath specifies the value + description: ReplaceFullPath specifies the value with which to replace the full path of a request - during a rewrite or redirect. \n " + during a rewrite or redirect. maxLength: 1024 type: string replacePrefixMatch: @@ -1205,7 +1200,7 @@ spec: When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path - `/abcd` would not. \n " + `/abcd` would not." maxLength: 1024 type: string type: @@ -1216,8 +1211,7 @@ spec: unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route - to `status: False`, with a Reason of `UnsupportedValue`. - \n " + to `status: False`, with a Reason of `UnsupportedValue`." enum: - ReplaceFullPath - ReplacePrefixMatch @@ -1410,24 +1404,24 @@ spec: urlRewrite: description: "URLRewrite defines a schema for a filter that modifies a request during forwarding. \n Support: - Extended \n " + Extended" properties: hostname: description: "Hostname is the value to be used to replace the Host header value during forwarding. - \n Support: Extended \n " + \n Support: Extended" 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 path: description: "Path defines a path rewrite. \n Support: - Extended \n " + Extended" properties: replaceFullPath: - description: "ReplaceFullPath specifies the value + description: ReplaceFullPath specifies the value with which to replace the full path of a request - during a rewrite or redirect. \n " + during a rewrite or redirect. maxLength: 1024 type: string replacePrefixMatch: @@ -1443,7 +1437,7 @@ spec: When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path - `/abcd` would not. \n " + `/abcd` would not." maxLength: 1024 type: string type: @@ -1454,8 +1448,7 @@ spec: unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route - to `status: False`, with a Reason of `UnsupportedValue`. - \n " + to `status: False`, with a Reason of `UnsupportedValue`." enum: - ReplaceFullPath - ReplacePrefixMatch @@ -2436,14 +2429,12 @@ spec: modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request - path is used as-is. \n Support: Extended \n - " + path is used as-is. \n Support: Extended" properties: replaceFullPath: - description: "ReplaceFullPath specifies - the value with which to replace the full - path of a request during a rewrite or - redirect. \n " + description: ReplaceFullPath specifies the + value with which to replace the full path + of a request during a rewrite or redirect. maxLength: 1024 type: string replacePrefixMatch: @@ -2460,8 +2451,7 @@ spec: When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix - `/abc`, but the path `/abcd` would not. - \n " + `/abc`, but the path `/abcd` would not." maxLength: 1024 type: string type: @@ -2474,7 +2464,7 @@ spec: values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason - of `UnsupportedValue`. \n " + of `UnsupportedValue`." enum: - ReplaceFullPath - ReplacePrefixMatch @@ -2681,25 +2671,24 @@ spec: urlRewrite: description: "URLRewrite defines a schema for a filter that modifies a request during forwarding. - \n Support: Extended \n " + \n Support: Extended" properties: hostname: description: "Hostname is the value to be used to replace the Host header value during forwarding. - \n Support: Extended \n " + \n Support: Extended" 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 path: description: "Path defines a path rewrite. \n - Support: Extended \n " + Support: Extended" properties: replaceFullPath: - description: "ReplaceFullPath specifies - the value with which to replace the full - path of a request during a rewrite or - redirect. \n " + description: ReplaceFullPath specifies the + value with which to replace the full path + of a request during a rewrite or redirect. maxLength: 1024 type: string replacePrefixMatch: @@ -2716,8 +2705,7 @@ spec: When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix - `/abc`, but the path `/abcd` would not. - \n " + `/abc`, but the path `/abcd` would not." maxLength: 1024 type: string type: @@ -2730,7 +2718,7 @@ spec: values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason - of `UnsupportedValue`. \n " + of `UnsupportedValue`." enum: - ReplaceFullPath - ReplacePrefixMatch @@ -3087,12 +3075,12 @@ spec: the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is. \n Support: - Extended \n " + Extended" properties: replaceFullPath: - description: "ReplaceFullPath specifies the value + description: ReplaceFullPath specifies the value with which to replace the full path of a request - during a rewrite or redirect. \n " + during a rewrite or redirect. maxLength: 1024 type: string replacePrefixMatch: @@ -3108,7 +3096,7 @@ spec: When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path - `/abcd` would not. \n " + `/abcd` would not." maxLength: 1024 type: string type: @@ -3119,8 +3107,7 @@ spec: unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route - to `status: False`, with a Reason of `UnsupportedValue`. - \n " + to `status: False`, with a Reason of `UnsupportedValue`." enum: - ReplaceFullPath - ReplacePrefixMatch @@ -3313,24 +3300,24 @@ spec: urlRewrite: description: "URLRewrite defines a schema for a filter that modifies a request during forwarding. \n Support: - Extended \n " + Extended" properties: hostname: description: "Hostname is the value to be used to replace the Host header value during forwarding. - \n Support: Extended \n " + \n Support: Extended" 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 path: description: "Path defines a path rewrite. \n Support: - Extended \n " + Extended" properties: replaceFullPath: - description: "ReplaceFullPath specifies the value + description: ReplaceFullPath specifies the value with which to replace the full path of a request - during a rewrite or redirect. \n " + during a rewrite or redirect. maxLength: 1024 type: string replacePrefixMatch: @@ -3346,7 +3333,7 @@ spec: When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path - `/abcd` would not. \n " + `/abcd` would not." maxLength: 1024 type: string type: @@ -3357,8 +3344,7 @@ spec: unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for the Route - to `status: False`, with a Reason of `UnsupportedValue`. - \n " + to `status: False`, with a Reason of `UnsupportedValue`." enum: - ReplaceFullPath - ReplacePrefixMatch diff --git a/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml b/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml index e2a8afefea..4a8f05d21b 100644 --- a/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml +++ b/config/crd/standard/gateway.networking.k8s.io_httproutes.yaml @@ -502,6 +502,54 @@ spec: minLength: 1 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string + path: + description: "Path defines parameters used to + modify the path of the incoming request. The + modified path is then used to construct the + `Location` header. When empty, the request + path is used as-is. \n Support: Extended" + properties: + replaceFullPath: + description: ReplaceFullPath specifies the + value with which to replace the full path + of a request during a rewrite or redirect. + maxLength: 1024 + type: string + replacePrefixMatch: + description: "ReplacePrefixMatch specifies + the value with which to replace the prefix + match of a request during a rewrite or + redirect. For example, a request to \"/foo/bar\" + with a prefix match of \"/foo\" would + be modified to \"/bar\". \n Note that + this matches the behavior of the PathPrefix + match type. This matches full path elements. + A path element refers to the list of labels + in the path split by the `/` separator. + When specified, a trailing `/` is ignored. + For example, the paths `/abc`, `/abc/`, + and `/abc/def` would all match the prefix + `/abc`, but the path `/abcd` would not." + maxLength: 1024 + type: string + type: + description: "Type defines the type of path + modifier. Additional types may be added + in a future release of the API. \n Note + that values may be added to this enum, + implementations must ensure that unknown + values will not cause a crash. \n Unknown + values here must result in the implementation + setting the Accepted Condition for the + Route to `status: False`, with a Reason + of `UnsupportedValue`." + enum: + - ReplaceFullPath + - ReplacePrefixMatch + type: string + required: + - type + type: object port: description: "Port is the port to be used in the value of the `Location` header in the @@ -587,8 +635,68 @@ spec: - RequestHeaderModifier - RequestMirror - RequestRedirect + - URLRewrite - ExtensionRef type: string + urlRewrite: + description: "URLRewrite defines a schema for a + filter that modifies a request during forwarding. + \n Support: Extended" + properties: + hostname: + description: "Hostname is the value to be used + to replace the Host header value during forwarding. + \n Support: Extended" + 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 + path: + description: "Path defines a path rewrite. \n + Support: Extended" + properties: + replaceFullPath: + description: ReplaceFullPath specifies the + value with which to replace the full path + of a request during a rewrite or redirect. + maxLength: 1024 + type: string + replacePrefixMatch: + description: "ReplacePrefixMatch specifies + the value with which to replace the prefix + match of a request during a rewrite or + redirect. For example, a request to \"/foo/bar\" + with a prefix match of \"/foo\" would + be modified to \"/bar\". \n Note that + this matches the behavior of the PathPrefix + match type. This matches full path elements. + A path element refers to the list of labels + in the path split by the `/` separator. + When specified, a trailing `/` is ignored. + For example, the paths `/abc`, `/abc/`, + and `/abc/def` would all match the prefix + `/abc`, but the path `/abcd` would not." + maxLength: 1024 + type: string + type: + description: "Type defines the type of path + modifier. Additional types may be added + in a future release of the API. \n Note + that values may be added to this enum, + implementations must ensure that unknown + values will not cause a crash. \n Unknown + values here must result in the implementation + setting the Accepted Condition for the + Route to `status: False`, with a Reason + of `UnsupportedValue`." + enum: + - ReplaceFullPath + - ReplacePrefixMatch + type: string + required: + - type + type: object + type: object required: - type type: object @@ -932,6 +1040,51 @@ spec: minLength: 1 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string + path: + description: "Path defines parameters used to modify + the path of the incoming request. The modified path + is then used to construct the `Location` header. + When empty, the request path is used as-is. \n Support: + Extended" + properties: + replaceFullPath: + description: ReplaceFullPath specifies the value + with which to replace the full path of a request + during a rewrite or redirect. + maxLength: 1024 + type: string + replacePrefixMatch: + description: "ReplacePrefixMatch specifies the + value with which to replace the prefix match + of a request during a rewrite or redirect. For + example, a request to \"/foo/bar\" with a prefix + match of \"/foo\" would be modified to \"/bar\". + \n Note that this matches the behavior of the + PathPrefix match type. This matches full path + elements. A path element refers to the list + of labels in the path split by the `/` separator. + When specified, a trailing `/` is ignored. For + example, the paths `/abc`, `/abc/`, and `/abc/def` + would all match the prefix `/abc`, but the path + `/abcd` would not." + maxLength: 1024 + type: string + type: + description: "Type defines the type of path modifier. + Additional types may be added in a future release + of the API. \n Note that values may be added + to this enum, implementations must ensure that + unknown values will not cause a crash. \n Unknown + values here must result in the implementation + setting the Accepted Condition for the Route + to `status: False`, with a Reason of `UnsupportedValue`." + enum: + - ReplaceFullPath + - ReplacePrefixMatch + type: string + required: + - type + type: object port: description: "Port is the port to be used in the value of the `Location` header in the response. \n When @@ -1010,8 +1163,65 @@ spec: - RequestHeaderModifier - RequestMirror - RequestRedirect + - URLRewrite - ExtensionRef type: string + urlRewrite: + description: "URLRewrite defines a schema for a filter + that modifies a request during forwarding. \n Support: + Extended" + properties: + hostname: + description: "Hostname is the value to be used to + replace the Host header value during forwarding. + \n Support: Extended" + 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 + path: + description: "Path defines a path rewrite. \n Support: + Extended" + properties: + replaceFullPath: + description: ReplaceFullPath specifies the value + with which to replace the full path of a request + during a rewrite or redirect. + maxLength: 1024 + type: string + replacePrefixMatch: + description: "ReplacePrefixMatch specifies the + value with which to replace the prefix match + of a request during a rewrite or redirect. For + example, a request to \"/foo/bar\" with a prefix + match of \"/foo\" would be modified to \"/bar\". + \n Note that this matches the behavior of the + PathPrefix match type. This matches full path + elements. A path element refers to the list + of labels in the path split by the `/` separator. + When specified, a trailing `/` is ignored. For + example, the paths `/abc`, `/abc/`, and `/abc/def` + would all match the prefix `/abc`, but the path + `/abcd` would not." + maxLength: 1024 + type: string + type: + description: "Type defines the type of path modifier. + Additional types may be added in a future release + of the API. \n Note that values may be added + to this enum, implementations must ensure that + unknown values will not cause a crash. \n Unknown + values here must result in the implementation + setting the Accepted Condition for the Route + to `status: False`, with a Reason of `UnsupportedValue`." + enum: + - ReplaceFullPath + - ReplacePrefixMatch + type: string + required: + - type + type: object + type: object required: - type type: object @@ -1925,6 +2135,54 @@ spec: minLength: 1 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string + path: + description: "Path defines parameters used to + modify the path of the incoming request. The + modified path is then used to construct the + `Location` header. When empty, the request + path is used as-is. \n Support: Extended" + properties: + replaceFullPath: + description: ReplaceFullPath specifies the + value with which to replace the full path + of a request during a rewrite or redirect. + maxLength: 1024 + type: string + replacePrefixMatch: + description: "ReplacePrefixMatch specifies + the value with which to replace the prefix + match of a request during a rewrite or + redirect. For example, a request to \"/foo/bar\" + with a prefix match of \"/foo\" would + be modified to \"/bar\". \n Note that + this matches the behavior of the PathPrefix + match type. This matches full path elements. + A path element refers to the list of labels + in the path split by the `/` separator. + When specified, a trailing `/` is ignored. + For example, the paths `/abc`, `/abc/`, + and `/abc/def` would all match the prefix + `/abc`, but the path `/abcd` would not." + maxLength: 1024 + type: string + type: + description: "Type defines the type of path + modifier. Additional types may be added + in a future release of the API. \n Note + that values may be added to this enum, + implementations must ensure that unknown + values will not cause a crash. \n Unknown + values here must result in the implementation + setting the Accepted Condition for the + Route to `status: False`, with a Reason + of `UnsupportedValue`." + enum: + - ReplaceFullPath + - ReplacePrefixMatch + type: string + required: + - type + type: object port: description: "Port is the port to be used in the value of the `Location` header in the @@ -2010,8 +2268,68 @@ spec: - RequestHeaderModifier - RequestMirror - RequestRedirect + - URLRewrite - ExtensionRef type: string + urlRewrite: + description: "URLRewrite defines a schema for a + filter that modifies a request during forwarding. + \n Support: Extended" + properties: + hostname: + description: "Hostname is the value to be used + to replace the Host header value during forwarding. + \n Support: Extended" + 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 + path: + description: "Path defines a path rewrite. \n + Support: Extended" + properties: + replaceFullPath: + description: ReplaceFullPath specifies the + value with which to replace the full path + of a request during a rewrite or redirect. + maxLength: 1024 + type: string + replacePrefixMatch: + description: "ReplacePrefixMatch specifies + the value with which to replace the prefix + match of a request during a rewrite or + redirect. For example, a request to \"/foo/bar\" + with a prefix match of \"/foo\" would + be modified to \"/bar\". \n Note that + this matches the behavior of the PathPrefix + match type. This matches full path elements. + A path element refers to the list of labels + in the path split by the `/` separator. + When specified, a trailing `/` is ignored. + For example, the paths `/abc`, `/abc/`, + and `/abc/def` would all match the prefix + `/abc`, but the path `/abcd` would not." + maxLength: 1024 + type: string + type: + description: "Type defines the type of path + modifier. Additional types may be added + in a future release of the API. \n Note + that values may be added to this enum, + implementations must ensure that unknown + values will not cause a crash. \n Unknown + values here must result in the implementation + setting the Accepted Condition for the + Route to `status: False`, with a Reason + of `UnsupportedValue`." + enum: + - ReplaceFullPath + - ReplacePrefixMatch + type: string + required: + - type + type: object + type: object required: - type type: object @@ -2355,6 +2673,51 @@ spec: minLength: 1 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string + path: + description: "Path defines parameters used to modify + the path of the incoming request. The modified path + is then used to construct the `Location` header. + When empty, the request path is used as-is. \n Support: + Extended" + properties: + replaceFullPath: + description: ReplaceFullPath specifies the value + with which to replace the full path of a request + during a rewrite or redirect. + maxLength: 1024 + type: string + replacePrefixMatch: + description: "ReplacePrefixMatch specifies the + value with which to replace the prefix match + of a request during a rewrite or redirect. For + example, a request to \"/foo/bar\" with a prefix + match of \"/foo\" would be modified to \"/bar\". + \n Note that this matches the behavior of the + PathPrefix match type. This matches full path + elements. A path element refers to the list + of labels in the path split by the `/` separator. + When specified, a trailing `/` is ignored. For + example, the paths `/abc`, `/abc/`, and `/abc/def` + would all match the prefix `/abc`, but the path + `/abcd` would not." + maxLength: 1024 + type: string + type: + description: "Type defines the type of path modifier. + Additional types may be added in a future release + of the API. \n Note that values may be added + to this enum, implementations must ensure that + unknown values will not cause a crash. \n Unknown + values here must result in the implementation + setting the Accepted Condition for the Route + to `status: False`, with a Reason of `UnsupportedValue`." + enum: + - ReplaceFullPath + - ReplacePrefixMatch + type: string + required: + - type + type: object port: description: "Port is the port to be used in the value of the `Location` header in the response. \n When @@ -2433,8 +2796,65 @@ spec: - RequestHeaderModifier - RequestMirror - RequestRedirect + - URLRewrite - ExtensionRef type: string + urlRewrite: + description: "URLRewrite defines a schema for a filter + that modifies a request during forwarding. \n Support: + Extended" + properties: + hostname: + description: "Hostname is the value to be used to + replace the Host header value during forwarding. + \n Support: Extended" + 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 + path: + description: "Path defines a path rewrite. \n Support: + Extended" + properties: + replaceFullPath: + description: ReplaceFullPath specifies the value + with which to replace the full path of a request + during a rewrite or redirect. + maxLength: 1024 + type: string + replacePrefixMatch: + description: "ReplacePrefixMatch specifies the + value with which to replace the prefix match + of a request during a rewrite or redirect. For + example, a request to \"/foo/bar\" with a prefix + match of \"/foo\" would be modified to \"/bar\". + \n Note that this matches the behavior of the + PathPrefix match type. This matches full path + elements. A path element refers to the list + of labels in the path split by the `/` separator. + When specified, a trailing `/` is ignored. For + example, the paths `/abc`, `/abc/`, and `/abc/def` + would all match the prefix `/abc`, but the path + `/abcd` would not." + maxLength: 1024 + type: string + type: + description: "Type defines the type of path modifier. + Additional types may be added in a future release + of the API. \n Note that values may be added + to this enum, implementations must ensure that + unknown values will not cause a crash. \n Unknown + values here must result in the implementation + setting the Accepted Condition for the Route + to `status: False`, with a Reason of `UnsupportedValue`." + enum: + - ReplaceFullPath + - ReplacePrefixMatch + type: string + required: + - type + type: object + type: object required: - type type: object diff --git a/examples/experimental/http-redirect.yaml b/examples/standard/http-redirect-path.yaml similarity index 100% rename from examples/experimental/http-redirect.yaml rename to examples/standard/http-redirect-path.yaml diff --git a/examples/experimental/http-redirect-rewrite/httproute-redirect-full.yaml b/examples/standard/http-redirect-rewrite/httproute-redirect-full.yaml similarity index 100% rename from examples/experimental/http-redirect-rewrite/httproute-redirect-full.yaml rename to examples/standard/http-redirect-rewrite/httproute-redirect-full.yaml diff --git a/examples/experimental/http-redirect-rewrite/httproute-redirect-https.yaml b/examples/standard/http-redirect-rewrite/httproute-redirect-https.yaml similarity index 100% rename from examples/experimental/http-redirect-rewrite/httproute-redirect-https.yaml rename to examples/standard/http-redirect-rewrite/httproute-redirect-https.yaml diff --git a/examples/experimental/http-redirect-rewrite/httproute-redirect-prefix.yaml b/examples/standard/http-redirect-rewrite/httproute-redirect-prefix.yaml similarity index 100% rename from examples/experimental/http-redirect-rewrite/httproute-redirect-prefix.yaml rename to examples/standard/http-redirect-rewrite/httproute-redirect-prefix.yaml diff --git a/examples/experimental/http-redirect-rewrite/httproute-rewrite-path.yaml b/examples/standard/http-redirect-rewrite/httproute-rewrite-path.yaml similarity index 100% rename from examples/experimental/http-redirect-rewrite/httproute-rewrite-path.yaml rename to examples/standard/http-redirect-rewrite/httproute-rewrite-path.yaml diff --git a/examples/experimental/http-redirect-rewrite/httproute-rewrite.yaml b/examples/standard/http-redirect-rewrite/httproute-rewrite.yaml similarity index 100% rename from examples/experimental/http-redirect-rewrite/httproute-rewrite.yaml rename to examples/standard/http-redirect-rewrite/httproute-rewrite.yaml diff --git a/examples/experimental/http-redirect-rewrite/httproute-rewritepath.yaml b/examples/standard/http-redirect-rewrite/httproute-rewritepath.yaml similarity index 100% rename from examples/experimental/http-redirect-rewrite/httproute-rewritepath.yaml rename to examples/standard/http-redirect-rewrite/httproute-rewritepath.yaml diff --git a/examples/experimental/http-rewrite.yaml b/examples/standard/http-rewrite.yaml similarity index 100% rename from examples/experimental/http-rewrite.yaml rename to examples/standard/http-rewrite.yaml diff --git a/geps/gep-726.md b/geps/gep-726.md index ef7406dd0b..7e4a04bd4b 100644 --- a/geps/gep-726.md +++ b/geps/gep-726.md @@ -1,7 +1,7 @@ # GEP-726: Add Path Redirects and Rewrites * Issue: [#726](https://github.com/kubernetes-sigs/gateway-api/issues/726) -* Status: Experimental +* Status: Standard ## TLDR diff --git a/mkdocs.yml b/mkdocs.yml index d2cc2260f8..5f78b8f85d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -88,7 +88,6 @@ nav: - geps/gep-1323.md - geps/gep-1016.md - geps/gep-957.md - - geps/gep-726.md - geps/gep-713.md - Standard: - geps/gep-1364.md @@ -97,6 +96,7 @@ nav: - geps/gep-851.md - geps/gep-820.md - geps/gep-746.md + - geps/gep-726.md - geps/gep-724.md - geps/gep-718.md - geps/gep-709.md diff --git a/site-src/guides/http-redirect-rewrite.md b/site-src/guides/http-redirect-rewrite.md index 10f48c6dec..b1f5f7d577 100644 --- a/site-src/guides/http-redirect-rewrite.md +++ b/site-src/guides/http-redirect-rewrite.md @@ -10,7 +10,7 @@ use both filter types at once. ## Redirects -Redirects return HTTP 3XX responses to a client, instructing it to retrive a +Redirects return HTTP 3XX responses to a client, instructing it to retrieve a different resource. [`RequestRedirect` rule filters](/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPRequestRedirectFilter) instruct Gateways to emit a redirect response to requests matching a filtered @@ -21,7 +21,7 @@ example, to issue a permanent redirect (301) from HTTP to HTTPS, configure `requestRedirect.statusCode=301` and `requestRedirect.scheme="https"`: ```yaml -{% include 'experimental/http-redirect-rewrite/httproute-redirect-https.yaml' %} +{% include 'standard/http-redirect-rewrite/httproute-redirect-https.yaml' %} ``` Redirects change configured URL components to match the redirect configuration @@ -36,15 +36,15 @@ unchanged. !!! info "Experimental Channel" The `Path` field described below is currently only included in the - "Experimental" channel of Gateway API. For more information on release - channels, refer to the [related documentation](https://gateway-api.sigs.k8s.io/concepts/versioning). + "Experimental" channel of Gateway API. Starting in v0.7.0, this + feature will graduate to the "Standard" channel. Path redirects use an HTTP Path Modifier to replace either entire paths or path prefixes. For example, the HTTPRoute below will issue a 302 redirect to all `redirect.example` requests whose path begins with `/cayenne` to `/paprika`: ```yaml -{% include 'experimental/http-redirect-rewrite/httproute-redirect-full.yaml' %} +{% include 'standard/http-redirect-rewrite/httproute-redirect-full.yaml' %} ``` Both requests to @@ -56,7 +56,7 @@ The other path redirect type, `ReplacePrefixMatch`, replaces only the path portion matching `matches.path.value`. Changing the filter in the above to: ```yaml -{% include 'experimental/http-redirect-rewrite/httproute-redirect-prefix.yaml' %} +{% include 'standard/http-redirect-rewrite/httproute-redirect-prefix.yaml' %} ``` will result in redirects with `location: @@ -65,12 +65,6 @@ https://redirect.example/paprika/teaspoon` response headers. ## Rewrites -!!! info "Experimental Channel" - - The `URLRewrite` filter described below is currently only included in the - "Experimental" channel of Gateway API. For more information on release - channels, refer to the [related documentation](https://gateway-api.sigs.k8s.io/concepts/versioning). - Rewrites modify components of a client request before proxying it upstream. A [`URLRewrite` filter](/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPURLRewriteFilter) @@ -81,7 +75,7 @@ following HTTPRoute will accept a request for rewrite.example`. ```yaml -{% include 'experimental/http-redirect-rewrite/httproute-rewrite.yaml' %} +{% include 'standard/http-redirect-rewrite/httproute-rewrite.yaml' %} ``` Path rewrites also make use of HTTP Path Modifiers. The HTTPRoute below @@ -91,5 +85,5 @@ Instead using `type: ReplacePrefixMatch` and `replacePrefixMatch: /fennel` will request `https://elsewhere.example/fennel/smidgen` upstream. ```yaml -{% include 'experimental/http-redirect-rewrite/httproute-rewritepath.yaml' %} +{% include 'standard/http-redirect-rewrite/httproute-rewritepath.yaml' %} ```