diff --git a/charts/gitops-runtime/templates/hooks/pre-install/validate-values.yaml b/charts/gitops-runtime/templates/hooks/pre-install/validate-values.yaml index 8c33193e..543c124b 100644 --- a/charts/gitops-runtime/templates/hooks/pre-install/validate-values.yaml +++ b/charts/gitops-runtime/templates/hooks/pre-install/validate-values.yaml @@ -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 }} + +--- apiVersion: batch/v1 kind: Job metadata: @@ -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 }}