Skip to content

Commit dce790a

Browse files
committed
Update SnippetFilter validation rules in enhancement proposal (nginx#2471)
Problem: The advanced nginx extensions proposal doesn't provide guidance on handling routes that reference invalid or nonexistent SnippetFilters. Solution: Add guidance on handling these cases to the enhancement proposal. The guidance is based off the Gateway API spec documentation.
1 parent 58cfa39 commit dce790a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/proposals/advanced-nginx-extensions.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,23 @@ one `http` snippet with multiple `http` snippets scattered around in the spec.
445445

446446
NGF will not validate the values of snippets. See the next section.
447447

448+
When a SnippetsFilter is specified in a routing rule and one of the following is true:
449+
450+
- the SnippetsFilter does not exist
451+
- the SnippetsFilter referenced is invalid
452+
- the same SnippetsFilter is referenced multiple times
453+
454+
the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a 500 HTTP error code response.
455+
In addition, the `ResolvedRefs` condition should be set to `False` with one of the following reasons:
456+
457+
- `FilterNotFound`
458+
- `InvalidFilter`
459+
460+
These reasons are not defined in the Gateway API library, so they will need to be added and documented.
461+
In addition, the `Accepted` route condition should be set to `True`.
462+
463+
Refer to [HTTPRouteFilter API](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.HTTPRouteFilter) for more implementation details.
464+
448465
#### NGINX Values
449466

450467
An invalid snippet can break NGINX config. When this happens, NGINX will continue to use the last valid configuration.

0 commit comments

Comments
 (0)