Skip to content

Commit ca6b952

Browse files
committed
feat: strict chart values schema
1 parent 3100353 commit ca6b952

File tree

2 files changed

+290
-15
lines changed

2 files changed

+290
-15
lines changed
Lines changed: 289 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,322 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$defs": {
4+
"Provider": {
5+
"type": "object",
6+
"properties": {
7+
"namespace": {
8+
"$ref": "#/$defs/Rfc1123SubdomainNameOrNull"
9+
},
10+
"version": {
11+
"$ref": "#/$defs/VersionOrNull"
12+
},
13+
"configSecret": {
14+
"type": "object",
15+
"properties": {
16+
"name": {
17+
"$ref": "#/$defs/Rfc1123SubdomainNameOrNull"
18+
},
19+
"namespace": {
20+
"$ref": "#/$defs/Rfc1123SubdomainNameOrNull"
21+
}
22+
},
23+
"additionalProperties": false
24+
},
25+
"manifestPatches": {
26+
"oneOf": [
27+
{
28+
"type": "null"
29+
},
30+
{
31+
"type": "array",
32+
"items": {
33+
"type": "string"
34+
}
35+
}
36+
]
37+
},
38+
"additionalManifests": {
39+
"type": "object",
40+
"properties": {
41+
"name": {
42+
"$ref": "#/$defs/Rfc1123SubdomainNameOrNull"
43+
},
44+
"namespace": {
45+
"$ref": "#/$defs/Rfc1123SubdomainNameOrNull"
46+
}
47+
},
48+
"additionalProperties": false
49+
}
50+
},
51+
"additionalProperties": false
52+
},
53+
"Rfc1123SubdomainNameOrNull": {
54+
"oneOf": [
55+
{
56+
"type": "null"
57+
},
58+
{
59+
"type": "string",
60+
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
61+
"minLength": 1,
62+
"maxLength": 253
63+
}
64+
]
65+
},
66+
"VersionOrNull": {
67+
"oneOf": [
68+
{
69+
"type": "null"
70+
},
71+
{
72+
"type": "string",
73+
"minLength": 1
74+
}
75+
]
76+
}
77+
},
378
"type": "object",
479
"properties": {
580
"core": {
681
"oneOf": [
7-
{ "type": "object" },
8-
{ "type": "null" }
82+
{
83+
"type": "null"
84+
},
85+
{
86+
"type": "object",
87+
"patternProperties": {
88+
"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$": {
89+
"$ref": "#/$defs/Provider"
90+
}
91+
},
92+
"additionalProperties": false
93+
}
994
]
1095
},
1196
"bootstrap": {
1297
"type": "object",
1398
"oneOf": [
14-
{ "type": "object" },
15-
{ "type": "null" }
99+
{
100+
"type": "null"
101+
},
102+
{
103+
"type": "object",
104+
"patternProperties": {
105+
"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$": {
106+
"$ref": "#/$defs/Provider"
107+
}
108+
},
109+
"additionalProperties": false
110+
}
16111
]
17112
},
18113
"controlPlane": {
19114
"type": "object",
20115
"oneOf": [
21-
{ "type": "object" },
22-
{ "type": "null" }
116+
{
117+
"type": "null"
118+
},
119+
{
120+
"type": "object",
121+
"patternProperties": {
122+
"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$": {
123+
"$ref": "#/$defs/Provider"
124+
}
125+
},
126+
"additionalProperties": false
127+
}
23128
]
24129
},
25130
"infrastructure": {
26131
"type": "object",
27132
"oneOf": [
28-
{ "type": "object" },
29-
{ "type": "null" }
133+
{
134+
"type": "null"
135+
},
136+
{
137+
"type": "object",
138+
"patternProperties": {
139+
"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$": {
140+
"$ref": "#/$defs/Provider"
141+
}
142+
},
143+
"additionalProperties": false
144+
}
30145
]
31146
},
32147
"addon": {
33148
"type": "object",
34149
"oneOf": [
35-
{ "type": "object" },
36-
{ "type": "null" }
150+
{
151+
"type": "null"
152+
},
153+
{
154+
"type": "object",
155+
"patternProperties": {
156+
"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$": {
157+
"$ref": "#/$defs/Provider"
158+
}
159+
},
160+
"additionalProperties": false
161+
}
37162
]
38163
},
39164
"ipam": {
40165
"type": "object",
41166
"oneOf": [
42-
{ "type": "object" },
43-
{ "type": "null" }
167+
{
168+
"type": "null"
169+
},
170+
{
171+
"type": "object",
172+
"patternProperties": {
173+
"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$": {
174+
"$ref": "#/$defs/Provider"
175+
}
176+
},
177+
"additionalProperties": false
178+
}
179+
]
180+
},
181+
"manager.featureGates": {
182+
"type": [
183+
"null",
184+
"object"
185+
]
186+
},
187+
"fetchConfig": {
188+
"type": [
189+
"null",
190+
"object"
191+
]
192+
},
193+
"configSecret": {
194+
"type": [
195+
"null",
196+
"object"
44197
]
198+
},
199+
"logLevel": {
200+
"type": [
201+
"null",
202+
"integer"
203+
]
204+
},
205+
"replicaCount": {
206+
"type": "integer"
207+
},
208+
"leaderElection": {
209+
"type": "object",
210+
"properties": {
211+
"enabled": {
212+
"type": "boolean"
213+
}
214+
},
215+
"additionalProperties": false
216+
},
217+
"image": {
218+
"type": "object",
219+
"properties": {
220+
"manager": {
221+
"type": "object",
222+
"properties": {
223+
"repository": {
224+
"type": "string"
225+
},
226+
"tag": {
227+
"type": "string"
228+
},
229+
"pullPolicy": {
230+
"type": "string"
231+
}
232+
},
233+
"additionalProperties": false
234+
}
235+
},
236+
"additionalProperties": false
237+
},
238+
"env": {
239+
"type": "object",
240+
"properties": {
241+
"manager": {
242+
"type": "array"
243+
}
244+
},
245+
"additionalProperties": false
246+
},
247+
"diagnosticsAddress": {
248+
"type": [
249+
"null",
250+
"string"
251+
]
252+
},
253+
"healthAddr": {
254+
"type": [
255+
"null",
256+
"string"
257+
]
258+
},
259+
"insecureDiagnostics": {
260+
"type": "boolean"
261+
},
262+
"watchConfigSecret": {
263+
"type": "boolean"
264+
},
265+
"imagePullSecrets": {
266+
"type": "array"
267+
},
268+
"resources": {
269+
"type": "object",
270+
"properties": {
271+
"manager": {
272+
"type": [
273+
"null",
274+
"object"
275+
]
276+
}
277+
},
278+
"additionalProperties": false
279+
},
280+
"containerSecurityContext": {
281+
"type": "object",
282+
"properties": {
283+
"manager": {
284+
"type": [
285+
"null",
286+
"object"
287+
]
288+
}
289+
},
290+
"additionalProperties": false
291+
},
292+
"affinity": {
293+
"type": [
294+
"null",
295+
"object"
296+
]
297+
},
298+
"tolerations": {
299+
"type": [
300+
"array"
301+
]
302+
},
303+
"volumes": {
304+
"type": [
305+
"array"
306+
]
307+
},
308+
"volumeMounts": {
309+
"type": "object",
310+
"properties": {
311+
"manager": {
312+
"type": "array"
313+
}
314+
},
315+
"additionalProperties": false
316+
},
317+
"enableHelmHook": {
318+
"type": "boolean"
45319
}
46-
}
47-
}
320+
},
321+
"additionalProperties": false
322+
}

hack/charts/cluster-api-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ diagnosticsAddress: ":8443"
4747
healthAddr: ":9440"
4848
insecureDiagnostics: false
4949
watchConfigSecret: false
50-
imagePullSecrets: {}
50+
imagePullSecrets: []
5151
resources:
5252
manager:
5353
limits:

0 commit comments

Comments
 (0)