mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-05 08:56:21 -03:00
Update _schedule.tpl
This commit is contained in:
@@ -14,12 +14,22 @@ objectData:
|
||||
|
||||
{{- $rootCtx := .rootCtx -}}
|
||||
{{- $objectData := .objectData }}
|
||||
{{- $namespace := ( include "tc.v1.common.lib.metadata.namespace" (dict "rootCtx" $rootCtx "objectData" $objectData "caller" "Schedule" ) -}}
|
||||
{{- $lookupBSL := (lookup "velero.io/v1" "BackupStorageLocation" "" "") -}}
|
||||
{{- if and $lookupBSL $lookupBSL.items -}}
|
||||
{{- with (index $lookupBSL.items 0) }}
|
||||
{{- $lookupBSL = . -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- if $lookupBSL -}}
|
||||
{{- $namespace = $lookupBSL.metadata.namespace -}}
|
||||
{{- end -}}
|
||||
---
|
||||
apiVersion: velero.io/v1
|
||||
kind: Schedule
|
||||
metadata:
|
||||
name: {{ $objectData.name }}
|
||||
namespace: {{ include "tc.v1.common.lib.metadata.namespace" (dict "rootCtx" $rootCtx "objectData" $objectData "caller" "Schedule") }}
|
||||
namespace: {{ $namespace }}
|
||||
{{- $labels := (mustMerge ($objectData.labels | default dict) (include "tc.v1.common.lib.metadata.allLabels" $rootCtx | fromYaml)) -}}
|
||||
{{- with (include "tc.v1.common.lib.metadata.render" (dict "rootCtx" $rootCtx "labels" $labels) | trim) }}
|
||||
labels:
|
||||
@@ -35,8 +45,13 @@ spec:
|
||||
{{- if (kindIs "bool" $objectData.useOwnerReferencesInBackup) }}
|
||||
useOwnerReferencesInBackup: {{ $objectData.useOwnerReferencesInBackup }}
|
||||
{{- end -}}
|
||||
{{- with $objectData.template }}
|
||||
template:
|
||||
{{- if or ( not $objectData.template ) ( and ( not $objectData.template ) ( not $objectData.template.includedNamespaces ) ) -}}
|
||||
includedNamespaces:
|
||||
- {{ include "tc.v1.common.lib.metadata.namespace" (dict "rootCtx" $rootCtx "objectData" $objectData "caller" "Schedule") }}
|
||||
{{- end -}}
|
||||
{{- with $objectData.template }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user