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

repositories:
- name: kyverno
  url: 'https://kyverno.github.io/kyverno/'

commonLabels:
  tier: system

apiVersions:
- monitoring.coreos.com/v1

releases:
- name: kyverno
  namespace: kyverno
  chart: kyverno/kyverno
  version: 3.7.1
  condition: kyverno.enabled
  values:
  - ../values/kyverno/values/kyverno.yaml.gotmpl
  - ../values/kyverno/values/kyverno-{{ .Environment.Name }}.yaml.gotmpl
  postRenderer: ../bin/kustomizer
  postRendererArgs:
  - ../values/kyverno/kustomize/{{ .Environment.Name }}
  missingFileHandler: Info
- name: manifests
  namespace: kyverno
  chart: manifests
  condition: kyverno.enabled
  missingFileHandler: Info
  values:
  - ../values/env.yaml
  - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml
  - ../values/kyverno/env.yaml.gotmpl
  - ../values/kyverno/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/kyverno/manifests
    - manifests
