mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
Co-authored-by: Maurits <75321636+maurits-funda@users.noreply.github.com> Co-authored-by: Noam Lerner <bugok@users.noreply.github.com>
12 lines
454 B
Smarty
12 lines
454 B
Smarty
{{/*
|
|
Validate job values
|
|
*/}}
|
|
{{- define "bjw-s.common.lib.job.validate" -}}
|
|
{{- $rootContext := .rootContext -}}
|
|
{{- $jobValues := .object -}}
|
|
|
|
{{- $allowedRestartPolicy := list "Never" "OnFailure" -}}
|
|
{{- if not (has $jobValues.pod.restartPolicy $allowedRestartPolicy) -}}
|
|
{{- fail (printf "Not a valid restart policy for Job (controller: %s, strategy: %s)" $jobValues.identifier $jobValues.pod.restartPolicy) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|