mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release v2.5.0 (#258)
Co-authored-by: Maurits <75321636+maurits-funda@users.noreply.github.com> Co-authored-by: Noam Lerner <bugok@users.noreply.github.com>
This commit is contained in:
parent
1582fe27c4
commit
a548690b00
25 changed files with 670 additions and 56 deletions
46
charts/library/common/templates/classes/_job.tpl
Normal file
46
charts/library/common/templates/classes/_job.tpl
Normal file
|
@ -0,0 +1,46 @@
|
|||
{{/*
|
||||
This template serves as the blueprint for the job objects that are created
|
||||
within the common library.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.class.job" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $jobObject := .object -}}
|
||||
|
||||
{{- $labels := merge
|
||||
(dict "app.kubernetes.io/component" $jobObject.identifier)
|
||||
($jobObject.labels | default dict)
|
||||
(include "bjw-s.common.lib.metadata.allLabels" $rootContext | fromYaml)
|
||||
-}}
|
||||
{{- $annotations := merge
|
||||
($jobObject.annotations | default dict)
|
||||
(include "bjw-s.common.lib.metadata.globalAnnotations" $rootContext | fromYaml)
|
||||
-}}
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ $jobObject.name }}
|
||||
{{- with $labels }}
|
||||
labels: {{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
{{- with $annotations }}
|
||||
annotations: {{- toYaml . | nindent 4 -}}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with $jobObject.job.suspend }}
|
||||
suspend: {{ ternary "true" "false" . }}
|
||||
{{- end }}
|
||||
{{- with $jobObject.job.ttlSecondsAfterFinished }}
|
||||
ttlSecondsAfterFinished: {{ . }}
|
||||
{{- end }}
|
||||
backoffLimit: {{ $jobObject.job.backoffLimit }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with (include "bjw-s.common.lib.pod.metadata.annotations" (dict "rootContext" $rootContext "controllerObject" $jobObject)) }}
|
||||
annotations: {{ . | nindent 8 }}
|
||||
{{- end -}}
|
||||
{{- with (include "bjw-s.common.lib.pod.metadata.labels" (dict "rootContext" $rootContext "controllerObject" $jobObject)) }}
|
||||
labels: {{ . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec: {{ include "bjw-s.common.lib.pod.spec" (dict "rootContext" $rootContext "controllerObject" $jobObject) | nindent 6 }}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue