mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release version 2.0.0-beta.1 (#173)
This commit is contained in:
parent
19767d668c
commit
7b6ee00be6
189 changed files with 3110 additions and 3023 deletions
11
charts/library/common/templates/lib/cronjob/_validate.tpl
Normal file
11
charts/library/common/templates/lib/cronjob/_validate.tpl
Normal file
|
@ -0,0 +1,11 @@
|
|||
{{/*
|
||||
Validate CronJob values
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.cronjob.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $cronjobValues := .object -}}
|
||||
|
||||
{{- if and (ne $cronjobValues.pod.restartPolicy "Never") (ne $cronjobValues.pod.restartPolicy "OnFailure") -}}
|
||||
{{- fail (printf "Not a valid restartPolicy type for CronJob. (controller: %s, restartPolicy: %s)" $cronjobValues.identifier $cronjobValues.pod.restartPolicy) }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -0,0 +1,18 @@
|
|||
{{/*
|
||||
Convert Cronjob values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.cronjob.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- if not (hasKey $objectValues "pod") -}}
|
||||
{{- $_ := set $objectValues "pod" dict -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $restartPolicy := default "Never" $objectValues.pod.restartPolicy -}}
|
||||
{{- $_ := set $objectValues.pod "restartPolicy" $restartPolicy -}}
|
||||
|
||||
{{- /* Return the CronJob object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue