Skip to content

Commit

Permalink
Update SnippetFilter validation rules in enhancement proposal (nginx#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
miledxz committed Aug 28, 2024
1 parent 58cfa39 commit dce790a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/proposals/advanced-nginx-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,23 @@ one `http` snippet with multiple `http` snippets scattered around in the spec.

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

When a SnippetsFilter is specified in a routing rule and one of the following is true:

- the SnippetsFilter does not exist
- the SnippetsFilter referenced is invalid
- the same SnippetsFilter is referenced multiple times

the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a 500 HTTP error code response.
In addition, the `ResolvedRefs` condition should be set to `False` with one of the following reasons:

- `FilterNotFound`
- `InvalidFilter`

These reasons are not defined in the Gateway API library, so they will need to be added and documented.
In addition, the `Accepted` route condition should be set to `True`.

Refer to [HTTPRouteFilter API](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.HTTPRouteFilter) for more implementation details.

#### NGINX Values

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

0 comments on commit dce790a

Please sign in to comment.