-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvalidate-values.yaml
50 lines (49 loc) · 1.45 KB
/
validate-values.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{{- if not .Values.installer.skipValidation }}
apiVersion: v1
kind: ConfigMap
metadata:
name: validate-values-config
annotations:
helm.sh/hook: pre-install,pre-upgrade
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation,hook-failed
helm.sh/hook-weight: "-10"
data:
values.yaml: |
{{ .Values | toYaml | indent 4 }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: validate-values
annotations:
helm.sh/hook: pre-install,pre-upgrade
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation
spec:
backoffLimit: 0
ttlSecondsAfterFinished: 300
template:
spec:
serviceAccount: validate-values-sa
restartPolicy: Never
containers:
- name: validate-values
image: "{{ .Values.installer.image.repository }}:{{ .Values.installer.image.tag | default .Chart.Version }}"
imagePullPolicy: {{ .Values.installer.image.pullPolicy }}
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: VERSION
value: {{ .Chart.Version }}
command: ["sh", "-c"]
args:
- cf helm validate --values /job_tmp/values.yaml --namespace ${NAMESPACE} --version ${VERSION} --hook --log-level debug
volumeMounts:
- name: customized-values
mountPath: "/job_tmp"
volumes:
- name: customized-values
configMap:
name: validate-values-config
{{- end }}