Skip to content

Commit 08bdb2b

Browse files
committed
address comments
1 parent 1825cf3 commit 08bdb2b

File tree

3 files changed

+11
-35
lines changed

3 files changed

+11
-35
lines changed

apis/v1alpha1/snippetsfilter_types.go

+4-14
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ import (
1010
// +kubebuilder:subresource:status
1111
// +kubebuilder:resource:categories=nginx-gateway-fabric,shortName=snippetsfilter
1212
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
13-
// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=direct"
1413

15-
// SnippetsFilter is an Direct Attached Policy. It allows inserting NGINX configuration into the
16-
// generated NGINX config for HTTPRoute, GRPCRoute and TLSRoute resources.
14+
// SnippetsFilter is a filter that allows inserting NGINX configuration into the
15+
// generated NGINX config for HTTPRoute and GRPCRoute resources.
1716
type SnippetsFilter struct {
1817
metav1.TypeMeta `json:",inline"`
1918
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -29,7 +28,7 @@ type SnippetsFilter struct {
2928
type SnippetsFilterSpec struct {
3029
// Snippets is a list of NGINX configuration snippets.
3130
// There can only be one snippet per context.
32-
// Allowed contexts: http, http.server, http.server.location, stream, stream.server.
31+
// Allowed contexts: http, http.server, http.server.location.
3332
Snippets []Snippet `json:"snippets"`
3433
}
3534

@@ -81,13 +80,10 @@ const (
8180

8281
// NginxContext represents the NGINX configuration context.
8382
//
84-
// +kubebuilder:validation:Enum=main;http;http;server;http.server;location;stream;stream.server
83+
// +kubebuilder:validation:Enum=http;http;server;http.server;location;
8584
type NginxContext string
8685

8786
const (
88-
// NginxContextMain is the main context of the NGINX configuration.
89-
NginxContextMain NginxContext = "main"
90-
9187
// NginxContextHTTP is the http context of the NGINX configuration.
9288
NginxContextHTTP NginxContext = "http"
9389

@@ -96,10 +92,4 @@ const (
9692

9793
// NginxContextHTTPServerLocation is the location context of the NGINX configuration.
9894
NginxContextHTTPServerLocation NginxContext = "http.server.location"
99-
100-
// NginxContextStream is the stream context of the NGINX configuration.
101-
NginxContextStream NginxContext = "stream"
102-
103-
// NginxContextStreamServer is the server context of the NGINX configuration.
104-
NginxContextStreamServer NginxContext = "stream.server"
10595
)

config/crd/bases/gateway.nginx.org_snippetsfilters.yaml

+3-8
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.16.1
7-
labels:
8-
gateway.networking.k8s.io/policy: direct
97
name: snippetsfilters.gateway.nginx.org
108
spec:
119
group: gateway.nginx.org
@@ -28,8 +26,8 @@ spec:
2826
schema:
2927
openAPIV3Schema:
3028
description: |-
31-
SnippetsFilter is an Direct Attached Policy. It allows inserting NGINX configuration into the
32-
generated NGINX config for HTTPRoute, GRPCRoute and TLSRoute resources.
29+
SnippetsFilter is a filter that allows inserting NGINX configuration into the
30+
generated NGINX config for HTTPRoute and GRPCRoute resources.
3331
properties:
3432
apiVersion:
3533
description: |-
@@ -55,7 +53,7 @@ spec:
5553
description: |-
5654
Snippets is a list of NGINX configuration snippets.
5755
There can only be one snippet per context.
58-
Allowed contexts: http, http.server, http.server.location, stream, stream.server.
56+
Allowed contexts: http, http.server, http.server.location.
5957
items:
6058
description: Snippet represents an NGINX configuration snippet.
6159
properties:
@@ -64,14 +62,11 @@ spec:
6462
Context is the NGINX context to insert the snippet
6563
into.
6664
enum:
67-
- main
6865
- http
6966
- http
7067
- server
7168
- http.server
7269
- location
73-
- stream
74-
- stream.server
7570
type: string
7671
value:
7772
description: Value is the NGINX configuration snippet.

site/content/reference/api.md

+4-13
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus
462462
<a class="headerlink" href="#gateway.nginx.org%2fv1alpha1.SnippetsFilter" title="Permanent link">¶</a>
463463
</h3>
464464
<p>
465-
<p>SnippetsFilter is an Direct Attached Policy. It allows inserting NGINX configuration into the
466-
generated NGINX config for HTTPRoute, GRPCRoute and TLSRoute resources.</p>
465+
<p>SnippetsFilter is a filter that allows inserting NGINX configuration into the
466+
generated NGINX config for HTTPRoute and GRPCRoute resources.</p>
467467
</p>
468468
<table class="table table-bordered table-striped">
469469
<thead>
@@ -530,7 +530,7 @@ SnippetsFilterSpec
530530
<td>
531531
<p>Snippets is a list of NGINX configuration snippets.
532532
There can only be one snippet per context.
533-
Allowed contexts: http, http.server, http.server.location, stream, stream.server.</p>
533+
Allowed contexts: http, http.server, http.server.location.</p>
534534
</td>
535535
</tr>
536536
</table>
@@ -917,15 +917,6 @@ ControllerLogLevel
917917
</tr><tr><td><p>&#34;http.server.location&#34;</p></td>
918918
<td><p>NginxContextHTTPServerLocation is the location context of the NGINX configuration.</p>
919919
</td>
920-
</tr><tr><td><p>&#34;main&#34;</p></td>
921-
<td><p>NginxContextMain is the main context of the NGINX configuration.</p>
922-
</td>
923-
</tr><tr><td><p>&#34;stream&#34;</p></td>
924-
<td><p>NginxContextStream is the stream context of the NGINX configuration.</p>
925-
</td>
926-
</tr><tr><td><p>&#34;stream.server&#34;</p></td>
927-
<td><p>NginxContextStreamServer is the server context of the NGINX configuration.</p>
928-
</td>
929920
</tr></tbody>
930921
</table>
931922
<h3 id="gateway.nginx.org/v1alpha1.NginxGatewayConditionReason">NginxGatewayConditionReason
@@ -1283,7 +1274,7 @@ SnippetsFilter is invalid.</p>
12831274
<td>
12841275
<p>Snippets is a list of NGINX configuration snippets.
12851276
There can only be one snippet per context.
1286-
Allowed contexts: http, http.server, http.server.location, stream, stream.server.</p>
1277+
Allowed contexts: http, http.server, http.server.location.</p>
12871278
</td>
12881279
</tr>
12891280
</tbody>

0 commit comments

Comments
 (0)