Skip to content

Commit 1c1a747

Browse files
Update CRDs
1 parent fd3f753 commit 1c1a747

24 files changed

+893
-34
lines changed

pkg/imports/crds/calico/v1.crd.projectcalico.org/crd.projectcalico.org_bgpconfigurations.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,21 @@ spec:
139139
type: array
140140
x-kubernetes-list-type: set
141141
type: object
142+
x-kubernetes-validations:
143+
- message:
144+
nodeMeshPassword cannot be set when nodeToNodeMeshEnabled is
145+
false
146+
reason: FieldValueForbidden
147+
rule:
148+
"!has(self.nodeMeshPassword) || !has(self.nodeToNodeMeshEnabled)
149+
|| self.nodeToNodeMeshEnabled == true"
150+
- message:
151+
nodeMeshMaxRestartTime cannot be set when nodeToNodeMeshEnabled
152+
is false
153+
reason: FieldValueForbidden
154+
rule:
155+
"!has(self.nodeMeshMaxRestartTime) || !has(self.nodeToNodeMeshEnabled)
156+
|| self.nodeToNodeMeshEnabled == true"
142157
type: object
143158
served: true
144159
storage: true

pkg/imports/crds/calico/v1.crd.projectcalico.org/crd.projectcalico.org_bgpfilters.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ spec:
3636
type: string
3737
cidr:
3838
format: cidr
39+
maxLength: 18
3940
type: string
4041
interface:
4142
type: string
@@ -68,6 +69,17 @@ spec:
6869
- action
6970
type: object
7071
x-kubernetes-map-type: atomic
72+
x-kubernetes-validations:
73+
- message: cidr and matchOperator must both be set or both be empty
74+
reason: FieldValueInvalid
75+
rule:
76+
(has(self.cidr) && size(self.cidr) > 0) == (has(self.matchOperator)
77+
&& size(self.matchOperator) > 0)
78+
- message: cidr is required when prefixLength is set
79+
reason: FieldValueInvalid
80+
rule:
81+
"!has(self.prefixLength) || (has(self.cidr) && size(self.cidr)
82+
> 0)"
7183
type: array
7284
exportV6:
7385
items:
@@ -79,6 +91,7 @@ spec:
7991
type: string
8092
cidr:
8193
format: cidr
94+
maxLength: 43
8295
type: string
8396
interface:
8497
type: string
@@ -111,6 +124,17 @@ spec:
111124
- action
112125
type: object
113126
x-kubernetes-map-type: atomic
127+
x-kubernetes-validations:
128+
- message: cidr and matchOperator must both be set or both be empty
129+
reason: FieldValueInvalid
130+
rule:
131+
(has(self.cidr) && size(self.cidr) > 0) == (has(self.matchOperator)
132+
&& size(self.matchOperator) > 0)
133+
- message: cidr is required when prefixLength is set
134+
reason: FieldValueInvalid
135+
rule:
136+
"!has(self.prefixLength) || (has(self.cidr) && size(self.cidr)
137+
> 0)"
114138
type: array
115139
importV4:
116140
items:
@@ -122,6 +146,7 @@ spec:
122146
type: string
123147
cidr:
124148
format: cidr
149+
maxLength: 18
125150
type: string
126151
interface:
127152
type: string
@@ -154,6 +179,17 @@ spec:
154179
- action
155180
type: object
156181
x-kubernetes-map-type: atomic
182+
x-kubernetes-validations:
183+
- message: cidr and matchOperator must both be set or both be empty
184+
reason: FieldValueInvalid
185+
rule:
186+
(has(self.cidr) && size(self.cidr) > 0) == (has(self.matchOperator)
187+
&& size(self.matchOperator) > 0)
188+
- message: cidr is required when prefixLength is set
189+
reason: FieldValueInvalid
190+
rule:
191+
"!has(self.prefixLength) || (has(self.cidr) && size(self.cidr)
192+
> 0)"
157193
type: array
158194
importV6:
159195
items:
@@ -165,6 +201,7 @@ spec:
165201
type: string
166202
cidr:
167203
format: cidr
204+
maxLength: 43
168205
type: string
169206
interface:
170207
type: string
@@ -197,6 +234,17 @@ spec:
197234
- action
198235
type: object
199236
x-kubernetes-map-type: atomic
237+
x-kubernetes-validations:
238+
- message: cidr and matchOperator must both be set or both be empty
239+
reason: FieldValueInvalid
240+
rule:
241+
(has(self.cidr) && size(self.cidr) > 0) == (has(self.matchOperator)
242+
&& size(self.matchOperator) > 0)
243+
- message: cidr is required when prefixLength is set
244+
reason: FieldValueInvalid
245+
rule:
246+
"!has(self.prefixLength) || (has(self.cidr) && size(self.cidr)
247+
> 0)"
200248
type: array
201249
type: object
202250
type: object

pkg/imports/crds/calico/v1.crd.projectcalico.org/crd.projectcalico.org_bgppeers.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ spec:
4141
format: int32
4242
type: integer
4343
localWorkloadSelector:
44+
maxLength: 4096
4445
type: string
4546
maxRestartTime:
4647
type: string
@@ -51,8 +52,10 @@ spec:
5152
- Keep
5253
type: string
5354
node:
55+
maxLength: 253
5456
type: string
5557
nodeSelector:
58+
maxLength: 4096
5659
type: string
5760
numAllowedLocalASNumbers:
5861
format: int32
@@ -74,8 +77,10 @@ spec:
7477
x-kubernetes-map-type: atomic
7578
type: object
7679
peerIP:
80+
maxLength: 64
7781
type: string
7882
peerSelector:
83+
maxLength: 4096
7984
type: string
8085
reachableBy:
8186
type: string
@@ -96,6 +101,37 @@ spec:
96101
ttlSecurity:
97102
type: integer
98103
type: object
104+
x-kubernetes-validations:
105+
- message: node and nodeSelector cannot both be set
106+
reason: FieldValueForbidden
107+
rule:
108+
(!has(self.node) || size(self.node) == 0) || (!has(self.nodeSelector)
109+
|| size(self.nodeSelector) == 0)
110+
- message: peerIP and peerSelector cannot both be set
111+
reason: FieldValueForbidden
112+
rule:
113+
(!has(self.peerIP) || size(self.peerIP) == 0) || (!has(self.peerSelector)
114+
|| size(self.peerSelector) == 0)
115+
- message: asNumber must be empty when peerSelector is set
116+
reason: FieldValueForbidden
117+
rule:
118+
(!has(self.peerSelector) || size(self.peerSelector) == 0) || !has(self.asNumber)
119+
|| self.asNumber == 0
120+
- message: peerIP must be empty when localWorkloadSelector is set
121+
reason: FieldValueForbidden
122+
rule:
123+
(!has(self.localWorkloadSelector) || size(self.localWorkloadSelector)
124+
== 0) || (!has(self.peerIP) || size(self.peerIP) == 0)
125+
- message: peerSelector must be empty when localWorkloadSelector is set
126+
reason: FieldValueForbidden
127+
rule:
128+
(!has(self.localWorkloadSelector) || size(self.localWorkloadSelector)
129+
== 0) || (!has(self.peerSelector) || size(self.peerSelector) == 0)
130+
- message: asNumber is required when localWorkloadSelector is set
131+
reason: FieldValueInvalid
132+
rule:
133+
(!has(self.localWorkloadSelector) || size(self.localWorkloadSelector)
134+
== 0) || (has(self.asNumber) && self.asNumber != 0)
99135
type: object
100136
served: true
101137
storage: true

pkg/imports/crds/calico/v1.crd.projectcalico.org/crd.projectcalico.org_felixconfigurations.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,10 @@ spec:
13541354
pattern: ^([0-9]+(\\.[0-9]+)?(ms|s|m|h))*$
13551355
type: string
13561356
type: object
1357+
x-kubernetes-validations:
1358+
- message: routeTableRange and routeTableRanges cannot both be set
1359+
reason: FieldValueForbidden
1360+
rule: "!has(self.routeTableRange) || !has(self.routeTableRanges)"
13571361
type: object
13581362
served: true
13591363
storage: true

pkg/imports/crds/calico/v1.crd.projectcalico.org/crd.projectcalico.org_globalnetworkpolicies.yaml

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,19 @@ spec:
9696
methods:
9797
items:
9898
type: string
99+
maxItems: 20
99100
type: array
100101
paths:
101102
items:
102103
properties:
103104
exact:
105+
maxLength: 1024
104106
type: string
105107
prefix:
108+
maxLength: 1024
106109
type: string
107110
type: object
111+
maxItems: 20
108112
type: array
109113
type: object
110114
icmp:
@@ -114,10 +118,14 @@ spec:
114118
minimum: 0
115119
type: integer
116120
type:
117-
maximum: 255
121+
maximum: 254
118122
minimum: 0
119123
type: integer
120124
type: object
125+
x-kubernetes-validations:
126+
- message: ICMP code specified without an ICMP type
127+
reason: FieldValueInvalid
128+
rule: "!has(self.code) || has(self.type)"
121129
ipVersion:
122130
enum:
123131
- 4
@@ -137,10 +145,14 @@ spec:
137145
minimum: 0
138146
type: integer
139147
type:
140-
maximum: 255
148+
maximum: 254
141149
minimum: 0
142150
type: integer
143151
type: object
152+
x-kubernetes-validations:
153+
- message: ICMP code specified without an ICMP type
154+
reason: FieldValueInvalid
155+
rule: "!has(self.code) || has(self.type)"
144156
notProtocol:
145157
anyOf:
146158
- type: integer
@@ -207,6 +219,22 @@ spec:
207219
required:
208220
- action
209221
type: object
222+
x-kubernetes-validations:
223+
- message: rules with HTTP match must have protocol TCP or unset
224+
reason: FieldValueInvalid
225+
rule:
226+
"!has(self.http) || !has(self.protocol) || self.protocol
227+
== 'TCP' || self.protocol == 6"
228+
- message: HTTP match is only valid on Allow rules
229+
reason: FieldValueForbidden
230+
rule: self.action == 'Allow' || !has(self.http)
231+
- message: ports and notPorts cannot be specified with services
232+
reason: FieldValueForbidden
233+
rule:
234+
"!has(self.destination) || !has(self.destination.services)
235+
|| (!has(self.destination.ports) || size(self.destination.ports)
236+
== 0) && (!has(self.destination.notPorts) || size(self.destination.notPorts)
237+
== 0)"
210238
type: array
211239
ingress:
212240
items:
@@ -274,15 +302,19 @@ spec:
274302
methods:
275303
items:
276304
type: string
305+
maxItems: 20
277306
type: array
278307
paths:
279308
items:
280309
properties:
281310
exact:
311+
maxLength: 1024
282312
type: string
283313
prefix:
314+
maxLength: 1024
284315
type: string
285316
type: object
317+
maxItems: 20
286318
type: array
287319
type: object
288320
icmp:
@@ -292,10 +324,14 @@ spec:
292324
minimum: 0
293325
type: integer
294326
type:
295-
maximum: 255
327+
maximum: 254
296328
minimum: 0
297329
type: integer
298330
type: object
331+
x-kubernetes-validations:
332+
- message: ICMP code specified without an ICMP type
333+
reason: FieldValueInvalid
334+
rule: "!has(self.code) || has(self.type)"
299335
ipVersion:
300336
enum:
301337
- 4
@@ -315,10 +351,14 @@ spec:
315351
minimum: 0
316352
type: integer
317353
type:
318-
maximum: 255
354+
maximum: 254
319355
minimum: 0
320356
type: integer
321357
type: object
358+
x-kubernetes-validations:
359+
- message: ICMP code specified without an ICMP type
360+
reason: FieldValueInvalid
361+
rule: "!has(self.code) || has(self.type)"
322362
notProtocol:
323363
anyOf:
324364
- type: integer
@@ -385,6 +425,22 @@ spec:
385425
required:
386426
- action
387427
type: object
428+
x-kubernetes-validations:
429+
- message: rules with HTTP match must have protocol TCP or unset
430+
reason: FieldValueInvalid
431+
rule:
432+
"!has(self.http) || !has(self.protocol) || self.protocol
433+
== 'TCP' || self.protocol == 6"
434+
- message: HTTP match is only valid on Allow rules
435+
reason: FieldValueForbidden
436+
rule: self.action == 'Allow' || !has(self.http)
437+
- message: ports and notPorts cannot be specified with services
438+
reason: FieldValueForbidden
439+
rule:
440+
"!has(self.destination) || !has(self.destination.services)
441+
|| (!has(self.destination.ports) || size(self.destination.ports)
442+
== 0) && (!has(self.destination.notPorts) || size(self.destination.notPorts)
443+
== 0)"
388444
type: array
389445
namespaceSelector:
390446
type: string
@@ -416,6 +472,29 @@ spec:
416472
type: array
417473
x-kubernetes-list-type: set
418474
type: object
475+
x-kubernetes-validations:
476+
- message: preDNAT and doNotTrack cannot both be true
477+
reason: FieldValueForbidden
478+
rule:
479+
"!((has(self.doNotTrack) && self.doNotTrack) && (has(self.preDNAT)
480+
&& self.preDNAT))"
481+
- message: preDNAT policy cannot have any egress rules
482+
reason: FieldValueForbidden
483+
rule:
484+
(!has(self.preDNAT) || !self.preDNAT) || !has(self.egress) ||
485+
size(self.egress) == 0
486+
- message: preDNAT policy cannot have 'Egress' type
487+
reason: FieldValueForbidden
488+
rule:
489+
(!has(self.preDNAT) || !self.preDNAT) || !has(self.types) || !self.types.exists(t,
490+
t == 'Egress')
491+
- message:
492+
applyOnForward must be true if either preDNAT or doNotTrack
493+
is true
494+
reason: FieldValueInvalid
495+
rule:
496+
(has(self.applyOnForward) && self.applyOnForward) || ((!has(self.doNotTrack)
497+
|| !self.doNotTrack) && (!has(self.preDNAT) || !self.preDNAT))
419498
type: object
420499
served: true
421500
storage: true

0 commit comments

Comments
 (0)