Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
salonichf5 committed Sep 3, 2024
1 parent 12f50b5 commit 67125be
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 35 deletions.
18 changes: 4 additions & 14 deletions apis/v1alpha1/snippetsfilter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import (
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories=nginx-gateway-fabric,shortName=snippetsfilter
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=direct"

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

Expand Down Expand Up @@ -81,13 +80,10 @@ const (

// NginxContext represents the NGINX configuration context.
//
// +kubebuilder:validation:Enum=main;http;http;server;http.server;location;stream;stream.server
// +kubebuilder:validation:Enum=http;http;server;http.server;location;
type NginxContext string

const (
// NginxContextMain is the main context of the NGINX configuration.
NginxContextMain NginxContext = "main"

// NginxContextHTTP is the http context of the NGINX configuration.
NginxContextHTTP NginxContext = "http"

Expand All @@ -96,10 +92,4 @@ const (

// NginxContextHTTPServerLocation is the location context of the NGINX configuration.
NginxContextHTTPServerLocation NginxContext = "http.server.location"

// NginxContextStream is the stream context of the NGINX configuration.
NginxContextStream NginxContext = "stream"

// NginxContextStreamServer is the server context of the NGINX configuration.
NginxContextStreamServer NginxContext = "stream.server"
)
11 changes: 3 additions & 8 deletions config/crd/bases/gateway.nginx.org_snippetsfilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
labels:
gateway.networking.k8s.io/policy: direct
name: snippetsfilters.gateway.nginx.org
spec:
group: gateway.nginx.org
Expand All @@ -28,8 +26,8 @@ spec:
schema:
openAPIV3Schema:
description: |-
SnippetsFilter is an Direct Attached Policy. It allows inserting NGINX configuration into the
generated NGINX config for HTTPRoute, GRPCRoute and TLSRoute resources.
SnippetsFilter is a filter that allows inserting NGINX configuration into the
generated NGINX config for HTTPRoute and GRPCRoute resources.
properties:
apiVersion:
description: |-
Expand All @@ -55,7 +53,7 @@ spec:
description: |-
Snippets is a list of NGINX configuration snippets.
There can only be one snippet per context.
Allowed contexts: http, http.server, http.server.location, stream, stream.server.
Allowed contexts: http, http.server, http.server.location.
items:
description: Snippet represents an NGINX configuration snippet.
properties:
Expand All @@ -64,14 +62,11 @@ spec:
Context is the NGINX context to insert the snippet
into.
enum:
- main
- http
- http
- server
- http.server
- location
- stream
- stream.server
type: string
value:
description: Value is the NGINX configuration snippet.
Expand Down
17 changes: 4 additions & 13 deletions site/content/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus
<a class="headerlink" href="#gateway.nginx.org%2fv1alpha1.SnippetsFilter" title="Permanent link">¶</a>
</h3>
<p>
<p>SnippetsFilter is an Direct Attached Policy. It allows inserting NGINX configuration into the
generated NGINX config for HTTPRoute, GRPCRoute and TLSRoute resources.</p>
<p>SnippetsFilter is a filter that allows inserting NGINX configuration into the
generated NGINX config for HTTPRoute and GRPCRoute resources.</p>
</p>
<table class="table table-bordered table-striped">
<thead>
Expand Down Expand Up @@ -530,7 +530,7 @@ SnippetsFilterSpec
<td>
<p>Snippets is a list of NGINX configuration snippets.
There can only be one snippet per context.
Allowed contexts: http, http.server, http.server.location, stream, stream.server.</p>
Allowed contexts: http, http.server, http.server.location.</p>
</td>
</tr>
</table>
Expand Down Expand Up @@ -917,15 +917,6 @@ ControllerLogLevel
</tr><tr><td><p>&#34;http.server.location&#34;</p></td>
<td><p>NginxContextHTTPServerLocation is the location context of the NGINX configuration.</p>
</td>
</tr><tr><td><p>&#34;main&#34;</p></td>
<td><p>NginxContextMain is the main context of the NGINX configuration.</p>
</td>
</tr><tr><td><p>&#34;stream&#34;</p></td>
<td><p>NginxContextStream is the stream context of the NGINX configuration.</p>
</td>
</tr><tr><td><p>&#34;stream.server&#34;</p></td>
<td><p>NginxContextStreamServer is the server context of the NGINX configuration.</p>
</td>
</tr></tbody>
</table>
<h3 id="gateway.nginx.org/v1alpha1.NginxGatewayConditionReason">NginxGatewayConditionReason
Expand Down Expand Up @@ -1283,7 +1274,7 @@ SnippetsFilter is invalid.</p>
<td>
<p>Snippets is a list of NGINX configuration snippets.
There can only be one snippet per context.
Allowed contexts: http, http.server, http.server.location, stream, stream.server.</p>
Allowed contexts: http, http.server, http.server.location.</p>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit 67125be

Please sign in to comment.