bases:
 - ../envs/environments.yaml.gotmpl

repositories:
- name: velero
  url: 'https://vmware-tanzu.github.io/helm-charts'

commonLabels:
  tier: system

apiVersions:
- monitoring.coreos.com/v1

releases:
- name: velero
  namespace: velero
  chart: velero/velero
  version: 12.0.0
  condition: velero.enabled
  values:
  - ../values/velero/values/velero.yaml.gotmpl
  - ../values/velero/values/velero-{{ .Environment.Name }}.yaml.gotmpl
  postRenderer: ../bin/kustomizer
  postRendererArgs:
  - ../values/velero/kustomize/{{ .Environment.Name }}
  missingFileHandler: Info
- name: manifests
  namespace: velero
  chart: manifests
  condition: velero.enabled
  missingFileHandler: Info
  values:
  - ../values/env.yaml
  - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml
  - ../values/velero/env.yaml.gotmpl
  - ../values/velero/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl
  hooks:
  - events: [ prepare, cleanup ]
    showlogs: true
    command: "../bin/helmify"
    args:
    - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}'
    - '{{`{{ .Release.Chart }}`}}'
    - '{{`{{ .Environment.Name }}`}}'
    - ../values/velero/manifests
    - manifests
