Skip to content

Commit d28ab7e

Browse files
ziraincnvergence
authored andcommitted
fix: reason with multiple errors rejected validation (#8859)
* fix: reason with multiple errors rejected validation Signed-off-by: zirain <zirain2009@gmail.com> * release notes Signed-off-by: zirain <zirain2009@gmail.com> * fix lint Signed-off-by: zirain <zirain2009@gmail.com> --------- Signed-off-by: zirain <zirain2009@gmail.com> (cherry picked from commit 7811d86)
1 parent 2620ff6 commit d28ab7e

5 files changed

Lines changed: 113 additions & 3 deletions

File tree

internal/gatewayapi/status/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func (m *MultiStatusError) Reason() gwapiv1.RouteConditionReason {
225225
reasonList = append(reasonList, reason)
226226
}
227227
sort.Strings(reasonList)
228-
return gwapiv1.RouteConditionReason(strings.Join(reasonList, ", "))
228+
return gwapiv1.RouteConditionReason(strings.Join(reasonList, ","))
229229
}
230230

231231
func (m *MultiStatusError) Type() gwapiv1.RouteConditionType {

internal/gatewayapi/testdata/grpcroute-with-conflicting-filters.out.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ grpcRoutes:
8080
message: |-
8181
Dropped Rule(s) [0]: Invalid filter ExtensionRef: unknown kind gateway.envoyproxy.io/HTTPRouteFilter.
8282
RequestMirror filter cannot be used when the rule also configures a DirectResponse filter.
83-
reason: IncompatibleFilters, UnsupportedValue
83+
reason: IncompatibleFilters,UnsupportedValue
8484
status: "True"
8585
type: PartiallyInvalid
8686
- lastTransitionTime: null

internal/gatewayapi/testdata/httproute-with-urlrewrite-hostname-filter.in.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,42 @@ httpRoutes:
125125
path:
126126
type: ReplacePrefixMatch
127127
replacePrefixMatch: /rewrite
128+
- apiVersion: gateway.networking.k8s.io/v1
129+
kind: HTTPRoute
130+
metadata:
131+
namespace: default
132+
name: httproute-5
133+
spec:
134+
hostnames:
135+
- gateway.envoyproxy.io
136+
parentRefs:
137+
- namespace: envoy-gateway
138+
name: gateway-1
139+
sectionName: http
140+
rules:
141+
- matches:
142+
- path:
143+
value: "/not-found-filter"
144+
backendRefs:
145+
- name: service-1
146+
port: 8080
147+
filters:
148+
- type: ExtensionRef
149+
extensionRef:
150+
group: gateway.envoyproxy.io
151+
kind: HTTPRouteFilter
152+
name: not-found-filter
153+
filters:
154+
- type: URLRewrite
155+
urlRewrite:
156+
path:
157+
type: ReplacePrefixMatch
158+
replacePrefixMatch: /rewrite
159+
- type: ExtensionRef
160+
extensionRef:
161+
group: gateway.envoyproxy.io
162+
kind: HTTPRouteFilter
163+
name: not-found-filter
128164
httpFilters:
129165
- apiVersion: gateway.envoyproxy.io/v1alpha1
130166
kind: HTTPRouteFilter

internal/gatewayapi/testdata/httproute-with-urlrewrite-hostname-filter.out.yaml

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ gateways:
1616
protocol: HTTP
1717
status:
1818
listeners:
19-
- attachedRoutes: 4
19+
- attachedRoutes: 5
2020
conditions:
2121
- lastTransitionTime: null
2222
message: Sending translated listener configuration to the data plane
@@ -222,6 +222,62 @@ httpRoutes:
222222
name: gateway-1
223223
namespace: envoy-gateway
224224
sectionName: http
225+
- apiVersion: gateway.networking.k8s.io/v1
226+
kind: HTTPRoute
227+
metadata:
228+
name: httproute-5
229+
namespace: default
230+
spec:
231+
hostnames:
232+
- gateway.envoyproxy.io
233+
parentRefs:
234+
- name: gateway-1
235+
namespace: envoy-gateway
236+
sectionName: http
237+
rules:
238+
- backendRefs:
239+
- filters:
240+
- extensionRef:
241+
group: gateway.envoyproxy.io
242+
kind: HTTPRouteFilter
243+
name: not-found-filter
244+
type: ExtensionRef
245+
name: service-1
246+
port: 8080
247+
filters:
248+
- type: URLRewrite
249+
urlRewrite:
250+
path:
251+
replacePrefixMatch: /rewrite
252+
type: ReplacePrefixMatch
253+
- extensionRef:
254+
group: gateway.envoyproxy.io
255+
kind: HTTPRouteFilter
256+
name: not-found-filter
257+
type: ExtensionRef
258+
matches:
259+
- path:
260+
value: /not-found-filter
261+
status:
262+
parents:
263+
- conditions:
264+
- lastTransitionTime: null
265+
message: Route is accepted
266+
reason: Accepted
267+
status: "True"
268+
type: Accepted
269+
- lastTransitionTime: null
270+
message: |-
271+
Unable to translate HTTPRouteFilter: default/not-found-filter.
272+
Failed to process route rule 0 backendRef 0: Unable to translate HTTPRouteFilter: default/not-found-filter.
273+
reason: InvalidBackendFilters,UnsupportedValue
274+
status: "False"
275+
type: ResolvedRefs
276+
controllerName: gateway.envoyproxy.io/gatewayclass-controller
277+
parentRef:
278+
name: gateway-1
279+
namespace: envoy-gateway
280+
sectionName: http
225281
infraIR:
226282
envoy-gateway/gateway-1:
227283
proxy:
@@ -357,6 +413,23 @@ xdsIR:
357413
path:
358414
fullReplace: null
359415
prefixMatchReplace: /rewrite
416+
- directResponse:
417+
statusCode: 500
418+
hostname: gateway.envoyproxy.io
419+
isHTTP2: false
420+
metadata:
421+
kind: HTTPRoute
422+
name: httproute-5
423+
namespace: default
424+
name: httproute/default/httproute-5/rule/0/match/0/gateway_envoyproxy_io
425+
pathMatch:
426+
distinct: false
427+
name: ""
428+
prefix: /not-found-filter
429+
urlRewrite:
430+
path:
431+
fullReplace: null
432+
prefixMatchReplace: /rewrite
360433
- destination:
361434
metadata:
362435
kind: HTTPRoute

release-notes/current.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ bug fixes: |
2828
Fixed `ws` and `wss` Backend appProtocols to force HTTP/1.1 upstream connections instead of negotiating HTTP/2, avoiding compatibility issues with WebSocket backends that do not support RFC 8441 extended CONNECT.
2929
Fixed gateway-helm RBAC in GatewayNamespace mode with explicit `watch.namespaces` list by adding controller-namespace secret read permissions to infra-manager.
3030
Fixed a control plane panic caused by concurrent Status mutation racing with the watchable Map coalesce goroutine.
31+
Fixed status conditions not being updated when a route is rejected due to multiple errors.
3132
3233
# Enhancements that improve performance.
3334
performance improvements: |

0 commit comments

Comments
 (0)