Skip to content

Commit 85a217e

Browse files
committed
Add missing field comments
1 parent ec68d7e commit 85a217e

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

apis/v1alpha1/proxysettingspolicy_types.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ type ProxySettingsPolicyList struct {
3737

3838
// ProxySettingsPolicySpec defines the desired state of the ProxySettingsPolicy.
3939
type ProxySettingsPolicySpec struct {
40-
Buffering *ProxyBuffering `json:"buffering,omitempty"`
40+
// Buffering configures the buffering of responses from the proxied server.
41+
//
42+
// +optional
43+
Buffering *ProxyBuffering `json:"buffering,omitempty"`
44+
45+
// TargetRefs identifies the API object(s) to apply the policy to.
46+
// Objects must be in the same namespace as the policy.
47+
// Support: Gateway, HTTPRoute, GRPCRoute
48+
//
49+
// +kubebuilder:validation:MinItems=1
50+
// +kubebuilder:validation:MaxItems=16
4151
TargetRefs []gatewayv1.LocalPolicyTargetReference `json:"targetRefs"`
4252
}
4353

@@ -77,6 +87,11 @@ type ProxyBuffering struct {
7787

7888
// ProxyBuffers defines the number and size of the proxy buffers.
7989
type ProxyBuffers struct {
80-
Size Size `json:"size"`
90+
// Size sets the size of each buffer.
91+
Size Size `json:"size"`
92+
93+
// Number sets the number of buffers.
94+
//
95+
// +kubebuilder:validation:Minimum=2
8196
Number int32 `json:"number"`
8297
}

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ spec:
5252
description: Spec defines the desired state of the ProxySettingsPolicy.
5353
properties:
5454
buffering:
55-
description: ProxyBuffering contains the settings for proxy buffering.
55+
description: Buffering configures the buffering of responses from
56+
the proxied server.
5657
properties:
5758
bufferSize:
5859
description: |-
@@ -70,13 +71,12 @@ spec:
7071
Directive: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers
7172
properties:
7273
number:
74+
description: Number sets the number of buffers.
7375
format: int32
76+
minimum: 2
7477
type: integer
7578
size:
76-
description: |-
77-
Size is a string value representing a size. Size can be specified in bytes, kilobytes (k), megabytes (m),
78-
or gigabytes (g).
79-
Examples: 1024, 8k, 1m.
79+
description: Size sets the size of each buffer.
8080
pattern: ^\d{1,4}(k|m|g)?$
8181
type: string
8282
required:
@@ -99,6 +99,10 @@ spec:
9999
type: boolean
100100
type: object
101101
targetRefs:
102+
description: |-
103+
TargetRefs identifies the API object(s) to apply the policy to.
104+
Objects must be in the same namespace as the policy.
105+
Support: Gateway, HTTPRoute, GRPCRoute
102106
items:
103107
description: |-
104108
LocalPolicyTargetReference identifies an API object to apply a direct or
@@ -128,6 +132,8 @@ spec:
128132
- kind
129133
- name
130134
type: object
135+
maxItems: 16
136+
minItems: 1
131137
type: array
132138
required:
133139
- targetRefs

deploy/crds.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9390,7 +9390,8 @@ spec:
93909390
description: Spec defines the desired state of the ProxySettingsPolicy.
93919391
properties:
93929392
buffering:
9393-
description: ProxyBuffering contains the settings for proxy buffering.
9393+
description: Buffering configures the buffering of responses from
9394+
the proxied server.
93949395
properties:
93959396
bufferSize:
93969397
description: |-
@@ -9408,13 +9409,12 @@ spec:
94089409
Directive: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers
94099410
properties:
94109411
number:
9412+
description: Number sets the number of buffers.
94119413
format: int32
9414+
minimum: 2
94129415
type: integer
94139416
size:
9414-
description: |-
9415-
Size is a string value representing a size. Size can be specified in bytes, kilobytes (k), megabytes (m),
9416-
or gigabytes (g).
9417-
Examples: 1024, 8k, 1m.
9417+
description: Size sets the size of each buffer.
94189418
pattern: ^\d{1,4}(k|m|g)?$
94199419
type: string
94209420
required:
@@ -9437,6 +9437,10 @@ spec:
94379437
type: boolean
94389438
type: object
94399439
targetRefs:
9440+
description: |-
9441+
TargetRefs identifies the API object(s) to apply the policy to.
9442+
Objects must be in the same namespace as the policy.
9443+
Support: Gateway, HTTPRoute, GRPCRoute
94409444
items:
94419445
description: |-
94429446
LocalPolicyTargetReference identifies an API object to apply a direct or
@@ -9466,6 +9470,8 @@ spec:
94669470
- kind
94679471
- name
94689472
type: object
9473+
maxItems: 16
9474+
minItems: 1
94699475
type: array
94709476
required:
94719477
- targetRefs

0 commit comments

Comments
 (0)