-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stephan Austermühle <[email protected]>
- Loading branch information
1 parent
9851531
commit 370b130
Showing
4 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{- range .Values.nextcloud.backupCronjobs }} | ||
--- | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: {{ template "nextcloud.fullname" $ }}-backup-{{ .name }} | ||
spec: | ||
schedule: {{ .schedule }} | ||
startingDeadlineSeconds: {{ .startingDeadlineSeconds }} | ||
concurrencyPolicy: {{ .concurrencyPolicy }} | ||
successfulJobsHistoryLimit: {{ .successfulJobsHistoryLimit }} | ||
suspend: {{ .suspend }} | ||
jobTemplate: | ||
{{/* Add the volumes */}} | ||
{{- $volumeList := concat (default list .jobTemplate.spec.template.spec.volumes) (include "nextcloud.backupCronJobVolumes" $ | fromYamlArray) -}} | ||
{{- $volumes := dict "spec" (dict "template" (dict "spec" (dict "volumes" $volumeList))) -}} | ||
{{- $jobTemplate := merge $volumes .jobTemplate -}} | ||
|
||
{{/* Add the volumeMounts to every container */}} | ||
{{- $containers := list -}} | ||
{{- range .jobTemplate.spec.template.spec.containers -}} | ||
{{- $vm := concat (default list .volumeMounts) (include "nextcloud.backupCronJobVolumeMounts" $ | fromYamlArray) -}} | ||
{{- $this := dict "volumeMounts" $vm -}} | ||
{{- $containers = append $containers (merge $this .) -}} | ||
{{- end -}} | ||
|
||
{{- $newContainers := dict "spec" (dict "template" (dict "spec" (dict "containers" $containers))) -}} | ||
{{- $jobTemplate = merge $newContainers $jobTemplate -}} | ||
|
||
{{- $jobTemplate | toYaml | nindent 4 -}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters