Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{{- 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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better change an indent value


---
apiVersion: batch/v1
kind: Job
metadata:
Expand Down Expand Up @@ -26,7 +39,12 @@ spec:
value: {{ .Chart.Version }}
command: ["sh", "-c"]
args:
- |
echo {{ .Values | toYaml | quote }} > values.yaml
cf helm validate --values values.yaml --namespace ${NAMESPACE} --version ${VERSION} --hook --log-level debug
- 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 }}