Skip to content

Commit 365cf93

Browse files
committed
schema/linting: update lint-and-validate-values for better schema validation
1 parent 2f4e08c commit 365cf93

File tree

1 file changed

+29
-49
lines changed

1 file changed

+29
-49
lines changed

tools/templates/lint-and-validate-values.yaml

Lines changed: 29 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,23 @@ hub:
7474
deploymentStrategy:
7575
type: Recreate
7676
rollingUpdate:
77+
labels: &labels
78+
mock-label1-key: mock-label1-value
79+
mock-label2-key: mock-label2-value
80+
annotations: &annotations
81+
mock-annotation1-key: mock-annotation1-value
82+
mock-annotation2-key: mock-annotation2-value
7783
db:
7884
type: sqlite-pvc
7985
upgrade:
8086
pvc:
81-
annotations:
82-
mock-annotation: mock
83-
selector:
84-
matchLabels:
85-
mock-selector: mock
87+
annotations: *annotations
8688
accessModes:
8789
- ReadWriteOnce
8890
storage: 1Gi
8991
subPath: /mock
9092
storageClassName: custom-storage-class
9193
url: custom-db-url
92-
labels:
93-
mock: mock
94-
annotations:
95-
mock: mock
9694
image:
9795
name: dummy-name
9896
tag: dummy-tag
@@ -111,7 +109,7 @@ hub:
111109
c.Spawner.cmd = 'mock'
112110
extraConfigMap:
113111
mock.entry: mock-config-map-entry
114-
extraEnv:
112+
extraEnv: &extraEnv
115113
IGNORED_KEY_NAME:
116114
name: MOCK_ENV_VAR_NAME1
117115
value: MOCK_ENV_VAR_VALUE1
@@ -120,10 +118,13 @@ hub:
120118
extraContainers: []
121119
extraVolumes: []
122120
extraVolumeMounts: []
123-
resources:
121+
resources: &resources
124122
requests:
125123
cpu: 100m
126124
memory: 512Mi
125+
limits:
126+
cpu: 200m
127+
memory: 1Gi
127128
lifecycle: &lifecycle
128129
postStart:
129130
exec:
@@ -171,25 +172,19 @@ proxy:
171172
port: 22
172173
targetPort: ssh
173174
type: LoadBalancer
174-
labels:
175-
MOCK_PROXY_ENV: mock
176-
annotations:
177-
hub.jupyter.org/mock-proxy-annotation: mock
175+
labels: *labels
176+
annotations: *annotations
178177
nodePorts:
179178
http:
180179
https:
181180
chp:
182181
extraCommandLineFlags:
183182
- "--auto-rewrite"
184183
- "--mock-flag {{ .Values.proxy.chp.resources.requests.memory }}"
185-
resources:
186-
requests:
187-
cpu: 100m
188-
memory: 512Mi
184+
resources: *resources
189185
defaultTarget: http://dummy.local/hello
190186
errorTarget: http://dummy.local/error
191-
extraEnv:
192-
MOCK_ENV: mock
187+
extraEnv: *extraEnv
193188
nodeSelector:
194189
node-type: mock
195190
tolerations:
@@ -213,17 +208,9 @@ proxy:
213208
extraPorts:
214209
- name: ssh
215210
containerPort: 8022
216-
labels:
217-
hub.jupyter.org/test-label: mock
218-
resources:
219-
requests:
220-
cpu: 200m
221-
memory: 512Mi
222-
limits:
223-
cpu: 200m
224-
memory: 1Gi
225-
extraEnv:
226-
LEGO_CA_CERTIFICATES: /etc/pebble/root-cert.pem
211+
labels: *labels
212+
resources: *resources
213+
extraEnv: *extraEnv
227214
nodeSelector:
228215
node-type: mock
229216
tolerations:
@@ -244,15 +231,8 @@ proxy:
244231
maxUnavailable: null
245232
minAvailable: 1
246233
secretSync:
247-
resources:
248-
requests:
249-
cpu: 100m
250-
memory: 128Mi
251-
limits:
252-
cpu: 200m
253-
memory: 1Gi
254-
labels:
255-
mock-proxy-label: mock
234+
resources: *resources
235+
labels: *labels
256236
https:
257237
enabled: true
258238
type: letsencrypt
@@ -347,8 +327,8 @@ singleuser:
347327
interNamespaceAccessLabels: ignore
348328
allowedIngressPorts: []
349329
events: true
350-
extraLabels: {}
351-
extraEnv: {}
330+
extraLabels: *labels
331+
extraEnv: *extraEnv
352332
lifecycleHooks: *lifecycle
353333
initContainers:
354334
- name: mock-init-container-name
@@ -363,8 +343,7 @@ singleuser:
363343
serviceAccountName:
364344
storage:
365345
type: dynamic
366-
extraLabels:
367-
mock-label: mock-value
346+
extraLabels: *labels
368347
extraVolumes: []
369348
extraVolumeMounts: []
370349
static:
@@ -420,7 +399,7 @@ scheduling:
420399
userPlaceholder:
421400
enabled: true
422401
replicas: 1
423-
resources: {}
402+
resources: *resources
424403
corePods:
425404
tolerations:
426405
- key: mock-taint-key-corePods
@@ -465,8 +444,7 @@ prePuller:
465444

466445
ingress:
467446
enabled: true
468-
annotations:
469-
mock: mock
447+
annotations: *annotations
470448
hosts:
471449
- mocked1.domain.name
472450
- mocked2.domain.name
@@ -487,7 +465,9 @@ cull:
487465
debug:
488466
enabled: true
489467

490-
global: {}
468+
global:
469+
whatever:
470+
this-should-be-accepted: true
491471

492472
custom:
493473
myCustomStuff: [hello]

0 commit comments

Comments
 (0)