Skip to content

Commit

Permalink
update based on reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
salonichf5 committed Aug 30, 2024
1 parent cc06e5b commit 1f074c0
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 141 deletions.
9 changes: 8 additions & 1 deletion apis/v1alpha1/snippetsfilter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ type Snippet struct {
Value string `json:"value"`
}

// SnippetsFilterList contains a list of Snippets.
type SnippetsFilterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Snippet `json:"items"`
}

// SnippetsFilterStatus defines the state of SnippetsFilter.
type SnippetsFilterStatus struct {
// Conditions describes the state of the SnippetsFilter.
Expand Down Expand Up @@ -80,7 +87,7 @@ const (

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

const (
Expand Down
22 changes: 22 additions & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

270 changes: 133 additions & 137 deletions config/crd/bases/gateway.nginx.org_snippetsfilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,152 +3,148 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.2
name: snippetsfilters.gateway.nginx.org
spec:
group: gateway.nginx.org
names:
categories:
- nginx-gateway-fabric
- nginx-gateway-fabric
kind: SnippetsFilter
listKind: SnippetsFilterList
plural: snippetsfilters
shortNames:
- snippetsfilter
- snippetsfilter
singular: snippetsfilter
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
SnippetsFilter is a filter that allows inserting NGINX configuration into the
generated NGINX config for HTTPRoute and GRPCRoute resources.
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of the SnippetsFilter.
properties:
snippets:
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.
items:
description: Snippet represents an NGINX configuration snippet.
properties:
context:
description:
Context is the NGINX context to insert the snippet
into.
enum:
- http
- http
- server
- http.server
- location
type: string
value:
description: Value is the NGINX configuration snippet.
type: string
required:
- context
- value
type: object
type: array
required:
- snippets
type: object
status:
description: Status defines the state of the SnippetsFilter.
properties:
conditions:
description: Conditions describes the state of the SnippetsFilter.
items:
description:
Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
maxItems: 8
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
SnippetsFilter is a filter that allows inserting NGINX configuration into the
generated NGINX config for HTTPRoute and GRPCRoute resources.
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of the SnippetsFilter.
properties:
snippets:
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.
items:
description: Snippet represents an NGINX configuration snippet.
properties:
context:
description: Context is the NGINX context to insert the snippet
into.
enum:
- http
- http.server
- http.server.location
type: string
value:
description: Value is the NGINX configuration snippet.
type: string
required:
- context
- value
type: object
type: array
required:
- snippets
type: object
status:
description: Status defines the state of the SnippetsFilter.
properties:
conditions:
description: Conditions describes the state of the SnippetsFilter.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
maxItems: 8
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
3 changes: 0 additions & 3 deletions site/content/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ title: "API reference"
weight: 100
toc: false
---

## Overview

NGINX Gateway API Reference

<p>Packages:</p>
<ul>
<li>
Expand Down

0 comments on commit 1f074c0

Please sign in to comment.